Skip to content

WebP exif is not being recognized #252

Description

@marcoffee

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

  • in a .zip or .tar.gz archive => to avoid GitHub removing or altering EXIF data
  • releasable under a Share-Alike license => any contributed file may be added this repository for regression testing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions