Don't delete gain map metadata if ignore_gain_map#3290
Merged
Conversation
da4133e to
7a5dd90
Compare
In avif::ReadImage(), if ignore_gain_map is true, don't delete gain map metadata. Let the caller do that. Also, since avif::ReadImage() calls avifImageCopy(), it doesn't need to call avifImageCreateView().
7a5dd90 to
05c73b4
Compare
wantehchang
commented
Jul 1, 2026
| if (base_image->gainMap) { | ||
| assert(base_image->gainMap->image == nullptr); | ||
| avifGainMapDestroy(base_image->gainMap); | ||
| } |
Member
Author
There was a problem hiding this comment.
This is the only caller of avif::ReadImage() that passes ignore_gain_map=true.
maryla-uc
approved these changes
Jul 2, 2026
But pass ignoreGainMap=false to the avifImageCreateView call.
wantehchang
commented
Jul 2, 2026
wantehchang
left a comment
Member
Author
There was a problem hiding this comment.
Thanks for the review.
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.
Don't delete gain map metadata if ignore_gain_map
In avif::ReadImage(), if ignore_gain_map is true, don't delete gain map
metadata. Let the caller do that.
Also, since avif::ReadImage() calls avifImageCopy(), it doesn't need to
call avifImageCreateView().