Skip to content

Add the ignoreICC option to avifDecoder#3280

Merged
wantehchang merged 4 commits into
AOMediaCodec:mainfrom
wantehchang:add-avifDecoder-ignoreProfileICC
Jul 6, 2026
Merged

Add the ignoreICC option to avifDecoder#3280
wantehchang merged 4 commits into
AOMediaCodec:mainfrom
wantehchang:add-avifDecoder-ignoreProfileICC

Conversation

@wantehchang

@wantehchang wantehchang commented Jun 25, 2026

Copy link
Copy Markdown
Member

This allows us to remove the ignoreColorProfile parameter from the
avifImageCreateView() function.

There is a change of behavior to avifdec:
The message "[--ignore-icc] Discarding ICC profile.\n" won't be printed
if the --ignore-icc or --icc option is specified and the image has an
ICC profile.

Bug: #3277

@wantehchang wantehchang force-pushed the add-avifDecoder-ignoreProfileICC branch from ecb09ed to 1ac6aed Compare June 27, 2026 00:14
@wantehchang wantehchang changed the title Add the ignoreProfileICC option to avifDecoder Add the ignoreColorProfile option to avifDecoder Jun 27, 2026
@wantehchang wantehchang force-pushed the add-avifDecoder-ignoreProfileICC branch from 1ac6aed to e4e13c8 Compare July 1, 2026 22:09
This allows us to remove the ignoreColorProfile parameter from the
avifImageCreateView() function.

There is a change of behavior to avifdec:
The message "[--ignore-icc] Discarding ICC profile.\n" won't be printed
if the --ignore-icc or --icc option is specified and the image has an
ICC profile.

Bug: AOMediaCodec#3277
@wantehchang wantehchang force-pushed the add-avifDecoder-ignoreProfileICC branch from e4e13c8 to 7c4cdf3 Compare July 2, 2026 15:25
@wantehchang wantehchang marked this pull request as ready for review July 2, 2026 15:32
@wantehchang wantehchang requested review from maryla-uc and y-guyon and removed request for y-guyon July 2, 2026 15:32

@maryla-uc maryla-uc left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you planning on porting this change to crabbyavif as well?

Comment thread CHANGELOG.md Outdated

@wantehchang wantehchang left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the review. I've ported the avifDecoder::ignoreColorProfile option to CrabbyAvif as you suggested. (See CrabbyAvif feature request webmproject/CrabbyAvif#829 and Google internal CL cl/942193170.)

Comment thread CHANGELOG.md Outdated
Comment thread CHANGELOG.md Outdated
Comment thread include/avif/avif.h

// Enable this to avoid reading and surfacing ICC profile to the decoded avifImage and gain map
// metadata.
avifBool ignoreICC;

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also renamed the ignoreColorProfile field to ignoreICC. The original reason is that the name ignore_icc blends in better with the CrabbyAvif source code. A new reason is that the ignoreColorProfile parameter of the avifReadImage() function in apps/shared/avifutil.h also controls the setting of the colorPrimaries and transferCharacteristics fields when decoding a PNG input file:

// Reads an image from a file with the requested format and depth.
// ...
// May set the image's colorPrimaries, transferCharacteristics and ICC fields
// based on color information found in the image (unless ignoreColorProfile is true).
avifAppFileFormat avifReadImage(const char * filename,
                                avifAppFileFormat inputFormat,
                                avifPixelFormat requestedFormat,
                                int requestedDepth,
                                avifChromaDownsampling chromaDownsampling,
                                avifBool ignoreColorProfile,
                                avifBool ignoreExif,
                                avifBool ignoreXMP,
                                avifBool ignoreAlpha,
                                avifBool ignoreGainMap,
                                uint32_t imageSizeLimit,
                                avifImage * image,
                                uint32_t * outDepth,
                                avifAppSourceTiming * sourceTiming,
                                struct y4mFrameIterator ** frameIter);

So the ignoreICC name is more precise.

@wantehchang wantehchang merged commit 5d9407c into AOMediaCodec:main Jul 6, 2026
25 checks passed
@wantehchang wantehchang changed the title Add the ignoreColorProfile option to avifDecoder Add the ignoreICC option to avifDecoder Jul 6, 2026
@wantehchang wantehchang deleted the add-avifDecoder-ignoreProfileICC branch July 6, 2026 17:02
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.

2 participants