Closed rijkvanzanten closed 1 year ago
Screenshots taken on a mac seem to "trigger" sharp to think there's exif data, but subsequently fail in exif-reader
This PNG image appears to store its EXIF data in the relatively new eXIf
PNG chunk rather than the historic iTXt
chunk.
The eXIf
chunk doesn't include the Exif\0
prefix whereas the iTXt
chunk does.
(libpng v1.6.32+ supports the eXIf
chunk. sharp recently started providing libspng to parse PNG images, which also supports it.)
Are you able to create a PR that updates the following logic to skip ahead 5 bytes when the Exif\0
prefix is found rather than throw when it's not? The image attached to this issue would make a great test case too.
Hi, I came across this https://github.com/sanity-io/exif-reader/commit/6ee2ee2f243cd6365ff4235a63797615a983fae1 which is precisely what is asked ?
v1.1.0 now available with support for this - please see https://github.com/devongovett/exif-reader/pull/21
Hi there!
I just ran into the same issue as https://github.com/devongovett/exif-reader/issues/11 ("Buffer must start with Exif") when using exif-reader on the "exif data" from a PNG. I'm using sharp to extract the metadata (as per the example in that other thread)
is this supposed to work? Is exif-reader capable of reading the exif data coming from a PNG? I'm assuming the error is thrown because of the format differences between exif data in JPEGs vs "exif" data under metadata chunks in PNGs? 🤔