question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

PNG Input + withMetadata() + .webp() = Input file is missing or of an unsupported image format

See original GitHub issue

Hi!

I’m trying to convert a png file to webp but seems like when I add the withMetadata to the mix I get the Input file is missing or of an unsupported image format. Any idea why it happens?

To reproduce:

// use a PNG image
sharp(image)
  .web()
  .resize(100)
  .withMetadata()
  .toBuffer()
  .then(...)

If I remove the withMetadata() it works fine.

Worth mentioning that If I don’t call .resize or any other operation… no error is raised but it output is a blank image.

PS: JPEG Images works fine. PS: Tested on sharp 0.20.2 and 0.20.3.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
lovellcommented, Jun 2, 2018

This was due to a bug in libvips - see https://github.com/jcupitt/libvips/pull/989

I expect v0.21.0 of sharp to provide an updated version of libvips that will include this fix.

1reaction
lovellcommented, Oct 4, 2018

sharp v0.21.0 is now available with a prebuilt libvips v8.7.0 that contains the upstream fix.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Gatsby build always throwing Input file is missing or of an ...
It turns out I actually had a missing image file. I am using gatsby-plugin-manifest and the image path I have put there is...
Read more >
Output options - High performance Node.js image processing
Write output image data to a file. If an explicit output format is not selected, it will be inferred from the extension, with...
Read more >
sharp - npm
High performance Node.js image processing, the fastest module to resize JPEG, PNG, WebP, GIF, AVIF and TIFF images. Latest version: 0.31.0, ...
Read more >
Bountysource
PNG Input + withMetadata() + .webp() = Input file is missing or of an unsupported image format.
Read more >
Keyboard Control - mpv.io
It supports a wide variety of video file formats, audio and video codecs, ... (there is no LIRC support - configure remotes as...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found