Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Metadata gone on png rotation (XMP, ICC profile, EXIF) #127

Closed
eugenesvk opened this issue Jan 8, 2023 · 5 comments
Closed

Metadata gone on png rotation (XMP, ICC profile, EXIF) #127

eugenesvk opened this issue Jan 8, 2023 · 5 comments
Assignees

Comments

@eugenesvk
Copy link

Original PNG (screenshot with a few bits of EXIF, XMP, ICC metadata)
oc

PNG rotated in Oculante
oc_rotate

Note that all XMP, ICC profile, EXIF metadata is gone

This might be due to the fact that the PNG lib oculante uses forgot to update to the "newer" PNG spec that supports metadata?
(from this SO answer EXIF is part of the PNG spec since 2017 (Version 1.5.0 (July 2017) of the Extensions to the PNG 1.2 Specification)

@woelper
Copy link
Owner

woelper commented Jan 9, 2023

All images end up as a generic image buffer when loaded, without any extra data - so this is expected. I would have to find a way to preserve this in a generic way to re-apply when saving.
On top of that, image does not easily support this (image-rs/image#1045) so I doubt this would be easy.

@eugenesvk
Copy link
Author

Oh, ok. For the exif data I'd repeat my comment from the sidecar issue: wait for the library to handle it (there are some solutions in that thread, not sure how viable they are)

The correct handling of color profile passthrough is tied to the ability to handle color profiles in general (since you might edit in a different one)?

So maybe just add a limitation note in the readme that this metadata is lost?

@woelper
Copy link
Owner

woelper commented Aug 16, 2023

I have been thinking about this, and since oculante supports loading of metadata and stores it in memory, it could write that upon saving, even if the underlying library does not do that by default. I'll try to prototype something for a small set (maybe png/jpeg first) and see how that works. I'd probably check for metadata being present and write it after saving to the file.

@woelper woelper self-assigned this Aug 18, 2023
@woelper
Copy link
Owner

woelper commented Aug 18, 2023

I've made a branch for this (linked) which seems promising. It's a bit brutal since it's a post-process, but it completely preserves EXIF, even if you save from jpeg to png or tiff.

@woelper woelper linked a pull request Aug 18, 2023 that will close this issue
@woelper
Copy link
Owner

woelper commented Sep 16, 2023

Metadata should now be preserved as-is when saving.

@woelper woelper closed this as completed Sep 16, 2023
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 a pull request may close this issue.

2 participants