Problem Description
It looks like after pull request #132 was merged, it stopped detecting Exif on (maybe some) WebP files.
Since we seek after detecting the tag "EXIF", it goes beyond the endianess marker and detects the endian_bytes as \x00.
A possible solution for this case (while retaining compatibility) might be to check if the current char is either an I or a M, and, if not, seeking forward, but it might not work when, e.g., the Exif contains one of those chars at this position, but it is not the endianess marker (which I think is not possible) or if the marker is different. To add robustness, we could also check for the full marker II or MM.
If the above solution is acceptable, I can create a PR for it, including the sample files below as tests.
Sample File
This is a zip containing 8 webp files, each with the possible Exif orientations (1-8). The exiftool cli detects them correctly (tested on 13.50). After applying the Exif orientation, they all should look like 1.webp. The Exif is at the end of each file.
webp_exif_orientations.zip
Problem Description
It looks like after pull request #132 was merged, it stopped detecting Exif on (maybe some) WebP files.
Since we seek after detecting the tag "EXIF", it goes beyond the endianess marker and detects the
endian_bytesas\x00.A possible solution for this case (while retaining compatibility) might be to check if the current char is either an
Ior aM, and, if not, seeking forward, but it might not work when, e.g., the Exif contains one of those chars at this position, but it is not the endianess marker (which I think is not possible) or if the marker is different. To add robustness, we could also check for the full markerIIorMM.If the above solution is acceptable, I can create a PR for it, including the sample files below as tests.
Sample File
This is a zip containing 8 webp files, each with the possible Exif orientations (1-8). The
exiftoolcli detects them correctly (tested on13.50). After applying the Exif orientation, they all should look like1.webp. The Exif is at the end of each file.webp_exif_orientations.zip