Include filtered Exif, XMP metadata in jpeg-xl according to user's preferences instead of all-or-nothing workaround.#21344
Open
dholth wants to merge 4 commits into
Open
Conversation
60f9dd3 to
360c844
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Filter Exif data in memory, then write using the jpeg-xl encoder. This method is appropriate for jpeg-xl and might be appropriate for the other special-cased formats.
In jpeg-xl the Exif data does not affect rendering, but obviously we like to have it. Some people prefer to have Exif at the beginning of the file, which we do here.
Since the encoder is capable of adding metadata, I like this method better than what darktable does for most formats (re-opens the file later to add metadata). Having the encoder add all the metadata greatly reduces the concern that older versions of Exiv2, or Exiv2 compiled without brotli support, are unable to read it.
My version of Exiv2 is able to add the XMP metadata in an
"xml "box at the end of the file. It would be nice to add the XMP metadata in the encoder as well, but this would require more refactors inimageio.cand a way to pass "should write xmp?" tojxl.c.When exporting to jpeg-xl using this patch, e.g.
$ jxlinfo -v P1180022.jxlshows that the file includes both Exif and xml (XMP) metadata.This PR builds on, includes #21342