devongovett / exif-reader

A small EXIF image metadata reader
MIT License
145 stars 22 forks source link

Ensure support for little endian without 'Exif\0\0' prefix #35

Closed lovell closed 6 months ago

lovell commented 6 months ago

Little endian EXIF without the Exif\0\0 prefix is currently being ignored as the 3rd/4th bytes will be hex 2a00 rather than (big endian) 002a.

sharp v0.33.0 onwards supports EXIF in PNG, defaulting to little endian without prefix, hence this problem appearing now.

The test file was created via:

  .withExif({
    IFD0: {
      Software: "sharp"
    }
  })

This should address https://github.com/devongovett/exif-reader/issues/34

Profesor08 commented 6 months ago

Just patched locally with patch-package, and it work well. It woll be great to be merged and published.