Skip to content

EXIF parser is JPEG-only, but docs advertise .heic support #6

Description

@cognis-digital

Summary

demos/README.txt tells users to "Drop .jpg/.heic photos in this folder", and the project description mentions broad image support, but geolens.core only parses JPEG APP1 segments:

  • _find_exif_segment() returns None unless the file starts with the JPEG SOI marker (\xff\xd8) and then walks JPEG markers to find an APP1 Exif\x00\x00 payload.
  • HEIC/HEIF stores EXIF inside an ISO-BMFF box structure (ftyp/meta/iinf/ilocExif item), not a JPEG APP1 marker. A .heic file therefore returns {} (no EXIF) even when it is fully geotagged.
  • PNG (eXIf chunk) and TIFF are likewise unsupported.

This is a silent correctness gap: a geotagged HEIC (the default iPhone format) reports "no location metadata", which is exactly the wrong answer for a triage tool.

Repro

from geolens.core import extract_exif
extract_exif(open("geotagged.heic", "rb").read())  # -> {} even with GPS present

Options

  1. Honest fix (docs): narrow the advertised support to JPEG until other containers are implemented — update demos/README.txt and the README.
  2. Real fix (feature): add an ISO-BMFF walker to locate the Exif item in HEIC/HEIF and hand its TIFF payload to the existing IFD parser (the TIFF/IFD code is already container-agnostic once you have the Exif\x00\x00-prefixed bytes). PNG eXIf is a smaller add.

Standard-library-only is feasible for both (both are just structured binary parsing, like the existing JPEG walker).

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