pngjs icon indicating copy to clipboard operation
pngjs copied to clipboard

Invalid file signature

Open inorganik opened this issue 6 years ago • 3 comments

Hi, I received the error "Invalid file signature" from this png:

http://manette-de-proust.lepodcast.fr/cover.png

I have used this lib with many other pngs and not gotten the error, so it could be a problem with the png, but this png can be resized with sharp no problem, and no errors.

Thanks for your work on this lib.

inorganik avatar Mar 03 '19 17:03 inorganik

I too have received this error, when trying to read this file: baseline

lvxwrkr777 avatar Apr 08 '20 19:04 lvxwrkr777

Same on files exported from Photoshop document. Can there be a way to bypass file signatures from trusted sources?

Inventsable avatar Jun 08 '20 05:06 Inventsable

Just as a followup this turned out to be a mistake on my end. I was using this with PixelMatch and feeding a queried URL into this library which I didn't realize was actually a JPG, not PNG. Once both images were correctly PNG I no longer had this issue.

It may be because the images above (and the same in my case) were created as JPG then renamed to be a .png extension instead of correctly exported as PNG

Inventsable avatar Jun 09 '20 03:06 Inventsable