- Notifications
You must be signed in to change notification settings - Fork673
Implementexif_metadata for TIFF#2613
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Exif metadata for TIFF is funny, as the Tiff file itself is stored in the exifdirectory structure. So the trivial answer to what is Exif metadata is just thebytes of the file itself...Co-authored-by: Rasmus Piorr <piorr@google.com>
Shnatsel commentedOct 30, 2025
I'm not a fan of this approach because if the application handles Exif like a black box and forwards it to the output (like most image conversion programs would do, including my own |
1c3t3a commentedOct 31, 2025
Thanks for the feedback, that makes sense! I think the alternative for sure results in less pixel data, but is also annoying for the image crate:
This will result in smaller exif blocks for sure, but currently has the problem that we cannot really write exif blocks easily in Rust. The only thing I found is the experimental Writer in kamadak-exif:https://docs.rs/kamadak-exif/0.6.1/exif/experimental/struct.Writer.html. |
197g commentedOct 31, 2025
Writing exif is the same as writing We have a choice here:
I tend towards (2). Currently, in |
1c3t3a commentedNov 5, 2025
Yeah I agree and thanks for the summary@197g! Then let me take a stab at (2). Would it be fine to add a dependency on kamadak-exif and its experimental |
197g commentedNov 5, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Definitely for sketch purposes and it is lightweight enough. The unsafe dependency needs some muster, I wonder what it is for. But should not hold up the implementation in principle as it does not leak immediately to the API as far as I can tell. |
Exif metadata for TIFF is funny, as the Tiff file itself is stored in the exif directory structure. So the trivial answer to what is Exif metadata is just the bytes of the file itself.
Note: This is not the most efficient way of obtaining the metadata as it also copies the image bytes, which we technically don't need. The alternative here is to add this to the tiff create and copy the correct metadata sections together. We didn't pursue this route as there were ideas to rework the entire
tiff::Valuetype and this would likely add a huge dependency on the current behavior. We're open for feedback if we should to go down that route, though.