Skip to content

Helper method to copy EXIF data#330

Open
197g wants to merge 6 commits intomainfrom
copy-or-extract-exif
Open

Helper method to copy EXIF data#330
197g wants to merge 6 commits intomainfrom
copy-or-extract-exif

Conversation

@197g
Copy link
Member

@197g 197g commented Jan 14, 2026

The main complexity here is that firstly the entries are a tree and secondly some entries are not-allowed or ill-advised when changing the photometric interpretation / planar configuration of the image data. So we have two use-cases here:

  • copying EXIF data while modifying the image sequence and re-writing the image.
  • copying EXIF data into an independent file.

This is solved by classifying tags through a TagFilter type. (As an experiment, that could include a 'Personally Identifiable Data' qualification but that is not super well-defined and I'd like to externalize the legal aspect in that through future extension methods, not seeing much adoption for this use without that, too). So there's All for copying tags just through their type and count and Known to ensure we at least semantically recognize the tags as part of EXIF v3 which enables us to remove tags that would conflict with a changed photometric interpretation / planar configuration.

197g added 3 commits January 13, 2026 23:46
This mirrors what the other value type provides, for now private and
only for IfdPointer which we need for iterating an existing directory.
@197g
Copy link
Member Author

197g commented Jan 14, 2026

Todo: Exif has an unrelated UTF-8 value type which is not standard (129).

An 8-bit byte representing a string according to UTF-8[22]. The final byte is
terminated with NULL[00.H]. BOM (Byte Order Mark) shall not be used. The
UTF-8 count shall include NULL.

It's not clear if we should just support this for all files. Technically only allowed in EXIF private directories but I have yet to encounter this otherwise. And we could fall back to ignoring the tag when UTF-8 validation fails. I don't know yet, so it's not part of this PR. Those tags are thrown away for now.

@197g 197g force-pushed the copy-or-extract-exif branch 2 times, most recently from 6452b1c to abaa3cf Compare January 14, 2026 18:19
197g added 3 commits January 15, 2026 20:21
This allows it to address the case of copying all EXIF data into a
separate file. And as soon as our decoder can handle files without any
image data (missing any stripoffsets, etc.) in ways that do not return
errors we can hopefully do the opposite and merge the data again.
@197g 197g force-pushed the copy-or-extract-exif branch from abaa3cf to 32dda6e Compare January 15, 2026 21:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments