Implement cICP chunk for PNG as per version 3 of the spec. [chromium/src : main]

28 views
Skip to first unread message

Dale Curtis (Gerrit)

unread,
Jun 14, 2022, 4:31:22 PM6/14/22
to Luca Versari, blink-...@chromium.org, cblume+im...@chromium.org, kinuko...@chromium.org, mbarowsky+watc...@chromium.org, Wan-Teh Chang, Peter Kasting, chromium...@chromium.org

Attention is currently required from: Luca Versari, Peter Kasting, Wan-Teh Chang.

View Change

3 comments:

  • Patchset:

    • Patch Set #2:

      +pkasting for OWNERs review, +wtc who is most recently familiar with what we've done for AVIF.

  • File third_party/blink/renderer/platform/image-decoders/png/png_image_decoder.cc:

    • Patch Set #2, Line 205: color_space.ToGfxColorSpace().GetAsFullRangeRGB().ToSkColorSpace();

      You support limited above, but this will always expand to full range. Did you mean to do that? Did you look over the limitations in ToSkColorSpace()?

  • File third_party/blink/renderer/platform/image-decoders/png/png_image_reader.cc:

    • Patch Set #2, Line 102: png_set_keep_unknown_chunks(png_, 3,

      Does this have any memory concerns? I.e., are there lots of PNGs out there with a ton of metadata that would cause us to waste memory on?

To view, visit change 3705739. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ia7717f161bd1569691e07c9216957814f2c073f0
Gerrit-Change-Number: 3705739
Gerrit-PatchSet: 2
Gerrit-Owner: Luca Versari <vel...@google.com>
Gerrit-Reviewer: Peter Kasting <pkas...@chromium.org>
Gerrit-Reviewer: Wan-Teh Chang <w...@google.com>
Gerrit-CC: Dale Curtis <dalec...@chromium.org>
Gerrit-Attention: Luca Versari <vel...@google.com>
Gerrit-Attention: Peter Kasting <pkas...@chromium.org>
Gerrit-Attention: Wan-Teh Chang <w...@google.com>
Gerrit-Comment-Date: Tue, 14 Jun 2022 20:31:14 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment

Luca Versari (Gerrit)

unread,
Jun 14, 2022, 4:37:28 PM6/14/22
to blink-...@chromium.org, cblume+im...@chromium.org, kinuko...@chromium.org, mbarowsky+watc...@chromium.org, Wan-Teh Chang, Peter Kasting, Dale Curtis, chromium...@chromium.org

Attention is currently required from: Dale Curtis, Peter Kasting, Wan-Teh Chang.

View Change

2 comments:

  • File third_party/blink/renderer/platform/image-decoders/png/png_image_decoder.cc:

    • You support limited above, but this will always expand to full range. […]

      I did mean to do it, in the sense that I know AVIF does the same.

      Is it the correct thing to do, that I'm less sure about ;)

  • File third_party/blink/renderer/platform/image-decoders/png/png_image_reader.cc:

    • Does this have any memory concerns? I.e. […]

      This should only keep cICP unknown chunks, which should be 4 bytes, so I don't think this is a memory concern.

      non-cICP unknown chunks are still discarded as before.

To view, visit change 3705739. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ia7717f161bd1569691e07c9216957814f2c073f0
Gerrit-Change-Number: 3705739
Gerrit-PatchSet: 2
Gerrit-Owner: Luca Versari <vel...@google.com>
Gerrit-Reviewer: Peter Kasting <pkas...@chromium.org>
Gerrit-Reviewer: Wan-Teh Chang <w...@google.com>
Gerrit-CC: Dale Curtis <dalec...@chromium.org>
Gerrit-Attention: Dale Curtis <dalec...@chromium.org>
Gerrit-Attention: Peter Kasting <pkas...@chromium.org>
Gerrit-Attention: Wan-Teh Chang <w...@google.com>
Gerrit-Comment-Date: Tue, 14 Jun 2022 20:37:19 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Dale Curtis <dalec...@chromium.org>
Gerrit-MessageType: comment

Peter Kasting (Gerrit)

unread,
Jun 14, 2022, 6:43:05 PM6/14/22
to Luca Versari, blink-...@chromium.org, cblume+im...@chromium.org, kinuko...@chromium.org, mbarowsky+watc...@chromium.org, Wan-Teh Chang, Dale Curtis, chromium...@chromium.org

Attention is currently required from: Dale Curtis, Luca Versari, Wan-Teh Chang.

Patch set 2:Code-Review +1

View Change

    To view, visit change 3705739. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ia7717f161bd1569691e07c9216957814f2c073f0
    Gerrit-Change-Number: 3705739
    Gerrit-PatchSet: 2
    Gerrit-Owner: Luca Versari <vel...@google.com>
    Gerrit-Reviewer: Peter Kasting <pkas...@chromium.org>
    Gerrit-Reviewer: Wan-Teh Chang <w...@google.com>
    Gerrit-CC: Dale Curtis <dalec...@chromium.org>
    Gerrit-Attention: Dale Curtis <dalec...@chromium.org>
    Gerrit-Attention: Luca Versari <vel...@google.com>
    Gerrit-Attention: Wan-Teh Chang <w...@google.com>
    Gerrit-Comment-Date: Tue, 14 Jun 2022 22:42:55 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: Yes
    Gerrit-MessageType: comment

    Dale Curtis (Gerrit)

    unread,
    Jun 14, 2022, 7:21:12 PM6/14/22
    to Luca Versari, blink-...@chromium.org, cblume+im...@chromium.org, kinuko...@chromium.org, mbarowsky+watc...@chromium.org, Peter Kasting, Wan-Teh Chang, chromium...@chromium.org

    Attention is currently required from: Luca Versari, Wan-Teh Chang.

    View Change

    1 comment:

    • File third_party/blink/renderer/platform/image-decoders/png/png_image_decoder.cc:

      • I did mean to do it, in the sense that I know AVIF does the same. […]

        That works because we later expand everything to full range when we can't use the YUV decoding path. Here I think you'll need to do a limited to full range expansion on the actual pixel data like we do for avif.

    To view, visit change 3705739. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ia7717f161bd1569691e07c9216957814f2c073f0
    Gerrit-Change-Number: 3705739
    Gerrit-PatchSet: 2
    Gerrit-Owner: Luca Versari <vel...@google.com>
    Gerrit-Reviewer: Peter Kasting <pkas...@chromium.org>
    Gerrit-Reviewer: Wan-Teh Chang <w...@google.com>
    Gerrit-CC: Dale Curtis <dalec...@chromium.org>
    Gerrit-Attention: Luca Versari <vel...@google.com>
    Gerrit-Attention: Wan-Teh Chang <w...@google.com>
    Gerrit-Comment-Date: Tue, 14 Jun 2022 23:21:05 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Dale Curtis <dalec...@chromium.org>
    Comment-In-Reply-To: Luca Versari <vel...@google.com>
    Gerrit-MessageType: comment

    Dale Curtis (Gerrit)

    unread,
    Jun 14, 2022, 7:21:36 PM6/14/22
    to Luca Versari, blink-...@chromium.org, cblume+im...@chromium.org, kinuko...@chromium.org, mbarowsky+watc...@chromium.org, Peter Kasting, Wan-Teh Chang, chromium...@chromium.org

    Attention is currently required from: Luca Versari, Wan-Teh Chang.

    View Change

    1 comment:

    • File third_party/blink/renderer/platform/image-decoders/png/png_image_reader.cc:

      • This should only keep cICP unknown chunks, which should be 4 bytes, so I don't think this is a memor […]

        Ah, sorry I misread this as enabling all unknown chunks.

    To view, visit change 3705739. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ia7717f161bd1569691e07c9216957814f2c073f0
    Gerrit-Change-Number: 3705739
    Gerrit-PatchSet: 2
    Gerrit-Owner: Luca Versari <vel...@google.com>
    Gerrit-Reviewer: Peter Kasting <pkas...@chromium.org>
    Gerrit-Reviewer: Wan-Teh Chang <w...@google.com>
    Gerrit-CC: Dale Curtis <dalec...@chromium.org>
    Gerrit-Attention: Luca Versari <vel...@google.com>
    Gerrit-Attention: Wan-Teh Chang <w...@google.com>
    Gerrit-Comment-Date: Tue, 14 Jun 2022 23:21:27 +0000

    Luca Versari (Gerrit)

    unread,
    Jun 15, 2022, 1:08:48 AM6/15/22
    to blink-...@chromium.org, cblume+im...@chromium.org, kinuko...@chromium.org, mbarowsky+watc...@chromium.org, Sami Boukortt, Peter Kasting, Wan-Teh Chang, Dale Curtis, chromium...@chromium.org

    Attention is currently required from: Dale Curtis, Wan-Teh Chang.

    View Change

    1 comment:

    • File third_party/blink/renderer/platform/image-decoders/png/png_image_decoder.cc:

      • That works because we later expand everything to full range when we can't use the YUV decoding path. […]

        Ah, good to know, we didn't spot that.

        I'd be somewhat tempted by just disallowing limited range RGB, at least for now -- I honestly find it hard to imagine such files would be ever produced.

        Otherwise, is there some range conversion code that one could use?

    To view, visit change 3705739. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ia7717f161bd1569691e07c9216957814f2c073f0
    Gerrit-Change-Number: 3705739
    Gerrit-PatchSet: 2
    Gerrit-Owner: Luca Versari <vel...@google.com>
    Gerrit-Reviewer: Peter Kasting <pkas...@chromium.org>
    Gerrit-Reviewer: Wan-Teh Chang <w...@google.com>
    Gerrit-CC: Dale Curtis <dalec...@chromium.org>
    Gerrit-CC: Sami Boukortt <sbou...@google.com>
    Gerrit-Attention: Dale Curtis <dalec...@chromium.org>
    Gerrit-Attention: Wan-Teh Chang <w...@google.com>
    Gerrit-Comment-Date: Wed, 15 Jun 2022 05:08:37 +0000

    Eugene Kliuchnikov (Gerrit)

    unread,
    Jun 15, 2022, 1:44:12 AM6/15/22
    to Luca Versari, blink-...@chromium.org, cblume+im...@chromium.org, kinuko...@chromium.org, mbarowsky+watc...@chromium.org, Sami Boukortt, Peter Kasting, Wan-Teh Chang, Dale Curtis, chromium...@chromium.org

    Attention is currently required from: Dale Curtis, Luca Versari, Wan-Teh Chang.

    View Change

    4 comments:

    • Patchset:

    • File third_party/blink/renderer/platform/image-decoders/png/png_image_decoder.cc:

      • Patch Set #2, Line 169: if (strcmp(reinterpret_cast<const char*>(unknown_chunks[i].name), "cICP") !=

        Is it possible to "const auto& chunk = unknown_chunks[i];" here?

      • Patch Set #2, Line 184: Per PNG spec

        Would be nice to have a reference to the spec (before loop) for the context.

      • Patch Set #2, Line 185: unknown_chunks[i].data[2]

        Along with "primaries" and "trc" would be great to have "m" and "f" variables for better readability.

    To view, visit change 3705739. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ia7717f161bd1569691e07c9216957814f2c073f0
    Gerrit-Change-Number: 3705739
    Gerrit-PatchSet: 2
    Gerrit-Owner: Luca Versari <vel...@google.com>
    Gerrit-Reviewer: Peter Kasting <pkas...@chromium.org>
    Gerrit-Reviewer: Wan-Teh Chang <w...@google.com>
    Gerrit-CC: Dale Curtis <dalec...@chromium.org>
    Gerrit-CC: Eugene Kliuchnikov <eus...@chromium.org>
    Gerrit-CC: Sami Boukortt <sbou...@google.com>
    Gerrit-Attention: Dale Curtis <dalec...@chromium.org>
    Gerrit-Attention: Luca Versari <vel...@google.com>
    Gerrit-Attention: Wan-Teh Chang <w...@google.com>
    Gerrit-Comment-Date: Wed, 15 Jun 2022 05:44:02 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Gerrit-MessageType: comment

    Chris Blume (Gerrit)

    unread,
    Jun 15, 2022, 6:45:03 AM6/15/22
    to Luca Versari, blink-...@chromium.org, cblume+im...@chromium.org, kinuko...@chromium.org, mbarowsky+watc...@chromium.org, Eugene Kliuchnikov, Sami Boukortt, Peter Kasting, Wan-Teh Chang, Dale Curtis, chromium...@chromium.org

    Attention is currently required from: Dale Curtis, Eugene Kliuchnikov, Luca Versari, Wan-Teh Chang.

    View Change

    5 comments:

    • File third_party/blink/renderer/platform/image-decoders/png/png_image_decoder.cc:

      • Would be nice to have a reference to the spec (before loop) for the context.

      • The current spec is only in editor's draft phase. Things are likely to change.
        https://w3c.github.io/PNG-spec/#11cICP
        Interestingly, that fragment "#11cICP" is probably one of the things that will change. So that link will break.

        As a side note, it might be good to mention why the PNG says m must be 0: It is for converting YUV to RGB and PNG doesn't currently support YUV.

      • Along with "primaries" and "trc" would be great to have "m" and "f" variables for better readability […]

        Agreed, but perhaps better names like |matrix_coefficients|.
        You'll see "f" is actually named |range| below.

      • Patch Set #2, Line 188: f

        Change "f" to |range|?

      • Ah, good to know, we didn't spot that. […]

        This might be less rare than you think.

        I learned about this via BBC test/reference images. As you might imagine, the web is unlikely to use limited range but TV is quite likely to use it. And once you then throw in Chromium-based smart TVs, it becomes fairly common and important.

        My understanding of the limited range is so an analog TV signal can hold a deep black for long enough that the TV says "ah, this is the back/front porch and I should start a new frame from the top". That means the broadcast image itself shouldn't hold that deep black for long enough (a few scan lines, IIRC).

        I haven't worked much with TVs but I could imagine a scenario where we could cause a TV to malfunction based on incorrect handling of limited range.

      • Patch Set #2, Line 221: // TODO(veluca): add support for iCCN.

        We'll likely not be adding a new iCCN chunk.
        Rather, we're repurposing the existing iCCP chunk to honor ICC v4 profiles.

        The official PNG spec says iCCP should only be ICC v2 profiles. But many places (including Chromium) treat it as v4 profiles already, anyway.

        One thing that may be changing is a UTF-8 BOM at the beginning of the profile name to indicate that the profile name is UTF-8 instead of Latin-1. (If we do this, we'll extend that behavior to other Latin-1-only chunks such as tEXt.

    To view, visit change 3705739. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ia7717f161bd1569691e07c9216957814f2c073f0
    Gerrit-Change-Number: 3705739
    Gerrit-PatchSet: 2
    Gerrit-Owner: Luca Versari <vel...@google.com>
    Gerrit-Reviewer: Peter Kasting <pkas...@chromium.org>
    Gerrit-Reviewer: Wan-Teh Chang <w...@google.com>
    Gerrit-CC: Chris Blume <cbl...@chromium.org>
    Gerrit-CC: Dale Curtis <dalec...@chromium.org>
    Gerrit-CC: Eugene Kliuchnikov <eus...@chromium.org>
    Gerrit-CC: Sami Boukortt <sbou...@google.com>
    Gerrit-Attention: Dale Curtis <dalec...@chromium.org>
    Gerrit-Attention: Luca Versari <vel...@google.com>
    Gerrit-Attention: Eugene Kliuchnikov <eus...@chromium.org>
    Gerrit-Attention: Wan-Teh Chang <w...@google.com>
    Gerrit-Comment-Date: Wed, 15 Jun 2022 10:44:49 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Dale Curtis <dalec...@chromium.org>
    Comment-In-Reply-To: Luca Versari <vel...@google.com>
    Comment-In-Reply-To: Eugene Kliuchnikov <eus...@chromium.org>
    Gerrit-MessageType: comment

    Luca Versari (Gerrit)

    unread,
    Jun 15, 2022, 10:37:41 AM6/15/22
    to blink-...@chromium.org, cblume+im...@chromium.org, kinuko...@chromium.org, mbarowsky+watc...@chromium.org, Moritz Firsching, Chris Blume, Eugene Kliuchnikov, Sami Boukortt, Peter Kasting, Wan-Teh Chang, Dale Curtis, chromium...@chromium.org

    Attention is currently required from: Chris Blume, Dale Curtis, Eugene Kliuchnikov, Wan-Teh Chang.

    View Change

    6 comments:

    • File third_party/blink/renderer/platform/image-decoders/png/png_image_decoder.cc:

      • Is it possible to "const auto& chunk = unknown_chunks[i];" here?

      • Done

      • The current spec is only in editor's draft phase. Things are likely to change. […]

        Done

      • Agreed, but perhaps better names like |matrix_coefficients|. […]

        Done

      • Done

      • This might be less rare than you think. […]

        I would argue, however, that such handling of limited range would be independent of _image_ formats (because, for example, web pages themselves assume full range), and that such situations should be handled rather via a final conversion to limited range. However I am not very familiar with the composition pipeline of Chrome and as such probably dalecurtis@ is better positioned to express an opinion here.

        My personal preference would be to try as much as possible to avoid new limited-range content to be created, ideally by disallowing it in the PNG spec (but that's a discussion for another place). I really struggle to see a meaningful usecase for limited-range PNG in a web browser (even if part of a smart TV).

        If that is not an option, I'd argue for either delaying the implementation of limited range RGB to a future CL, or even a future libpng update; however if there is a simple way to handle this in Chrome itself, it could also be an option to do it in this CL.

      • We'll likely not be adding a new iCCN chunk. […]

        I removed the comment for now. I don't *think* Chrome would need to do anything to support UTF-8 profile names, as I don't think it uses names for anything.

    To view, visit change 3705739. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ia7717f161bd1569691e07c9216957814f2c073f0
    Gerrit-Change-Number: 3705739
    Gerrit-PatchSet: 2
    Gerrit-Owner: Luca Versari <vel...@google.com>
    Gerrit-Reviewer: Peter Kasting <pkas...@chromium.org>
    Gerrit-Reviewer: Wan-Teh Chang <w...@google.com>
    Gerrit-CC: Chris Blume <cbl...@chromium.org>
    Gerrit-CC: Dale Curtis <dalec...@chromium.org>
    Gerrit-CC: Eugene Kliuchnikov <eus...@chromium.org>
    Gerrit-CC: Moritz Firsching <firs...@google.com>
    Gerrit-CC: Sami Boukortt <sbou...@google.com>
    Gerrit-Attention: Dale Curtis <dalec...@chromium.org>
    Gerrit-Attention: Chris Blume <cbl...@chromium.org>
    Gerrit-Attention: Eugene Kliuchnikov <eus...@chromium.org>
    Gerrit-Attention: Wan-Teh Chang <w...@google.com>
    Gerrit-Comment-Date: Wed, 15 Jun 2022 14:37:28 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Dale Curtis <dalec...@chromium.org>
    Comment-In-Reply-To: Chris Blume <cbl...@chromium.org>

    Dale Curtis (Gerrit)

    unread,
    Jun 15, 2022, 12:21:21 PM6/15/22
    to Luca Versari, blink-...@chromium.org, cblume+im...@chromium.org, kinuko...@chromium.org, mbarowsky+watc...@chromium.org, Moritz Firsching, Chris Blume, Eugene Kliuchnikov, Sami Boukortt, Peter Kasting, Wan-Teh Chang, chromium...@chromium.org

    Attention is currently required from: Chris Blume, Eugene Kliuchnikov, Luca Versari, Wan-Teh Chang.

    View Change

    1 comment:

    • File third_party/blink/renderer/platform/image-decoders/png/png_image_decoder.cc:

      • Patch Set #2, Line 205: color_space.ToGfxColorSpace().GetAsFullRangeRGB().ToSkColorSpace();

        I would argue, however, that such handling of limited range would be independent of _image_ formats […]

        Are you able to construct a limited range RGB PNG using any tooling today?

        IIUC limited range is fairly uncommon in non-YUV contexts, since PNG doesn't support YUV at this time, disabling support for it for now sgtm. You may want to print a DLOG(WARNING) so it's obvious it's not working properly to a future chrome dev.

        You can use the same gfx::ColorTransform that we use in AVIF, but it's very slow. You may be able to just use Skia and specify a limited -> full YUV space of the same color space (i.e. BT709_Limited -> BT709_Full), but we'd need to test/check with skia folk since that may incur precision loss.

    To view, visit change 3705739. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ia7717f161bd1569691e07c9216957814f2c073f0
    Gerrit-Change-Number: 3705739
    Gerrit-PatchSet: 3
    Gerrit-Owner: Luca Versari <vel...@google.com>
    Gerrit-Reviewer: Peter Kasting <pkas...@chromium.org>
    Gerrit-Reviewer: Wan-Teh Chang <w...@google.com>
    Gerrit-CC: Chris Blume <cbl...@chromium.org>
    Gerrit-CC: Dale Curtis <dalec...@chromium.org>
    Gerrit-CC: Eugene Kliuchnikov <eus...@chromium.org>
    Gerrit-CC: Moritz Firsching <firs...@google.com>
    Gerrit-CC: Sami Boukortt <sbou...@google.com>
    Gerrit-Attention: Luca Versari <vel...@google.com>
    Gerrit-Attention: Chris Blume <cbl...@chromium.org>
    Gerrit-Attention: Eugene Kliuchnikov <eus...@chromium.org>
    Gerrit-Attention: Wan-Teh Chang <w...@google.com>
    Gerrit-Comment-Date: Wed, 15 Jun 2022 16:21:11 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Dale Curtis <dalec...@chromium.org>
    Comment-In-Reply-To: Luca Versari <vel...@google.com>
    Comment-In-Reply-To: Chris Blume <cbl...@chromium.org>
    Gerrit-MessageType: comment

    Chris Blume

    unread,
    Jun 15, 2022, 12:28:03 PM6/15/22
    to change-...@chromium-review.googlesource.com, Luca Versari, blink-...@chromium.org, cblume+im...@chromium.org, kinuko...@chromium.org, mbarowsky+watc...@chromium.org, Moritz Firsching, Eugene Kliuchnikov, Sami Boukortt, Peter Kasting, Wan-Teh Chang, chromium...@chromium.org
    My power is out (likely until Friday) so my ability to respond is limited. Sorry about that. (Look up AEP in Columbus, Ohio for details of the outage.)

    Am *I* able to create a limited range PNG? No.
    But the BBC has tooling where they do exactly that for their reference images.

    Maybe a good path forward is to put this behind a flag. That way no TVs could suddenly misbehave. Plus this is not yet a complete PNG spec anyway so it probably shouldn't be default behavior yet.

    Chris Blume (Gerrit)

    unread,
    Jun 15, 2022, 12:28:12 PM6/15/22
    to Luca Versari, blink-...@chromium.org, cblume+im...@chromium.org, kinuko...@chromium.org, mbarowsky+watc...@chromium.org, Moritz Firsching, Eugene Kliuchnikov, Sami Boukortt, Peter Kasting, Wan-Teh Chang, Dale Curtis, chromium...@chromium.org

    Attention is currently required from: Chris Blume, Eugene Kliuchnikov, Luca Versari, Wan-Teh Chang.

    My power is out (likely until Friday) so my ability to respond is limited. Sorry about that. (Look up AEP in Columbus, Ohio for details of the outage.)

    Am *I* able to create a limited range PNG? No.

    But the BBC has tooling where they do exactly that for their reference images.

    Maybe a good path forward is to put this behind a flag. That way no TVs could suddenly misbehave. Plus this is not yet a complete PNG spec anyway so it probably shouldn't be default behavior yet.

    View Change

    1 comment:

      • My power is out (likely until Friday) so my ability to respond is limited. Sorry about that. (Look up AEP in Columbus, Ohio for details of the outage.)

        Am *I* able to create a limited range PNG? No.

        But the BBC has tooling where they do exactly that for their reference images.

        Maybe a good path forward is to put this behind a flag. That way no TVs could suddenly misbehave. Plus this is not yet a complete PNG spec anyway so it probably shouldn't be default behavior yet.

    To view, visit change 3705739. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ia7717f161bd1569691e07c9216957814f2c073f0
    Gerrit-Change-Number: 3705739
    Gerrit-PatchSet: 3
    Gerrit-Owner: Luca Versari <vel...@google.com>
    Gerrit-Reviewer: Peter Kasting <pkas...@chromium.org>
    Gerrit-Reviewer: Wan-Teh Chang <w...@google.com>
    Gerrit-CC: Chris Blume <cbl...@chromium.org>
    Gerrit-CC: Dale Curtis <dalec...@chromium.org>
    Gerrit-CC: Eugene Kliuchnikov <eus...@chromium.org>
    Gerrit-CC: Moritz Firsching <firs...@google.com>
    Gerrit-CC: Sami Boukortt <sbou...@google.com>
    Gerrit-Attention: Luca Versari <vel...@google.com>
    Gerrit-Attention: Chris Blume <cbl...@chromium.org>
    Gerrit-Attention: Eugene Kliuchnikov <eus...@chromium.org>
    Gerrit-Attention: Wan-Teh Chang <w...@google.com>
    Gerrit-Comment-Date: Wed, 15 Jun 2022 16:28:03 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Gerrit-MessageType: comment

    Wan-Teh Chang (Gerrit)

    unread,
    Jun 15, 2022, 1:17:18 PM6/15/22
    to Luca Versari, blink-...@chromium.org, cblume+im...@chromium.org, kinuko...@chromium.org, mbarowsky+watc...@chromium.org, Wan-Teh Chang, Moritz Firsching, Chris Blume, Eugene Kliuchnikov, Sami Boukortt, Peter Kasting, Dale Curtis, chromium...@chromium.org

    Attention is currently required from: Chris Blume, Eugene Kliuchnikov, Luca Versari.

    Patch set 3:Code-Review -1

    The change is no longer submittable: Code-Review is unsatisfied now.

    View Change

    10 comments:

    • Patchset:

    • File third_party/blink/renderer/platform/image-decoders/png/png_image_decoder.cc:

    • File third_party/blink/renderer/platform/image-decoders/png/png_image_reader.cc:

    To view, visit change 3705739. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ia7717f161bd1569691e07c9216957814f2c073f0
    Gerrit-Change-Number: 3705739
    Gerrit-PatchSet: 3
    Gerrit-Owner: Luca Versari <vel...@google.com>
    Gerrit-Reviewer: Peter Kasting <pkas...@chromium.org>
    Gerrit-Reviewer: Wan-Teh Chang <w...@google.com>
    Gerrit-CC: Chris Blume <cbl...@chromium.org>
    Gerrit-CC: Dale Curtis <dalec...@chromium.org>
    Gerrit-CC: Eugene Kliuchnikov <eus...@chromium.org>
    Gerrit-CC: Moritz Firsching <firs...@google.com>
    Gerrit-CC: Sami Boukortt <sbou...@google.com>
    Gerrit-Attention: Luca Versari <vel...@google.com>
    Gerrit-Attention: Chris Blume <cbl...@chromium.org>
    Gerrit-Attention: Eugene Kliuchnikov <eus...@chromium.org>
    Gerrit-Comment-Date: Wed, 15 Jun 2022 17:17:09 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    Gerrit-MessageType: comment

    Dale Curtis (Gerrit)

    unread,
    Jun 15, 2022, 1:27:26 PM6/15/22
    to Luca Versari, blink-...@chromium.org, cblume+im...@chromium.org, kinuko...@chromium.org, mbarowsky+watc...@chromium.org, Wan-Teh Chang, Moritz Firsching, Chris Blume, Eugene Kliuchnikov, Sami Boukortt, Peter Kasting, chromium...@chromium.org

    Attention is currently required from: Chris Blume, Eugene Kliuchnikov, Luca Versari.

    View Change

    1 comment:

    • Patchset:

      • Patch Set #3:

        My power is out (likely until Friday) so my ability to respond is limited. Sorry about that. […]

        Yes limited range is extremely common in video contexts. I think it's important to differentiate if one can produce a limited range PNG in RGB though.

        If tooling can't produce them (i.e. perhaps as an artifact of how the RGB encoding is done) a TODO is fine for now. If the spec allows them to be created they should eventually be handled.

    To view, visit change 3705739. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ia7717f161bd1569691e07c9216957814f2c073f0
    Gerrit-Change-Number: 3705739
    Gerrit-PatchSet: 3
    Gerrit-Owner: Luca Versari <vel...@google.com>
    Gerrit-Reviewer: Peter Kasting <pkas...@chromium.org>
    Gerrit-Reviewer: Wan-Teh Chang <w...@google.com>
    Gerrit-CC: Chris Blume <cbl...@chromium.org>
    Gerrit-CC: Dale Curtis <dalec...@chromium.org>
    Gerrit-CC: Eugene Kliuchnikov <eus...@chromium.org>
    Gerrit-CC: Moritz Firsching <firs...@google.com>
    Gerrit-CC: Sami Boukortt <sbou...@google.com>
    Gerrit-Attention: Luca Versari <vel...@google.com>
    Gerrit-Attention: Chris Blume <cbl...@chromium.org>
    Gerrit-Attention: Eugene Kliuchnikov <eus...@chromium.org>
    Gerrit-Comment-Date: Wed, 15 Jun 2022 17:27:14 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No

    Chris Blume

    unread,
    Jun 15, 2022, 1:35:20 PM6/15/22
    to change-...@chromium-review.googlesource.com, Luca Versari, blink-...@chromium.org, cblume+im...@chromium.org, kinuko...@chromium.org, mbarowsky+watc...@chromium.org, Wan-Teh Chang, Moritz Firsching, Eugene Kliuchnikov, Sami Boukortt, Peter Kasting, chromium...@chromium.org
    I think the link between YUV and limited range is causal. It is just whether or not dark darks and bright brights are allowed in the data vs. used as signaling (like a new frame starting), right?

    As far as CICP size (4 vs. 7 bytes), I will continue to read H.273 once my power is restored. I don't have a print out.

    Chris Blume (Gerrit)

    unread,
    Jun 15, 2022, 1:35:36 PM6/15/22
    to Luca Versari, blink-...@chromium.org, cblume+im...@chromium.org, kinuko...@chromium.org, mbarowsky+watc...@chromium.org, Wan-Teh Chang, Moritz Firsching, Eugene Kliuchnikov, Sami Boukortt, Peter Kasting, Dale Curtis, chromium...@chromium.org

    Attention is currently required from: Chris Blume, Eugene Kliuchnikov, Luca Versari.

    I think the link between YUV and limited range is causal. It is just whether or not dark darks and bright brights are allowed in the data vs. used as signaling (like a new frame starting), right?

    As far as CICP size (4 vs. 7 bytes), I will continue to read H.273 once my power is restored. I don't have a print out.

    View Change

    1 comment:

    • Patchset:

      • Patch Set #3:

        I think the link between YUV and limited range is causal. It is just whether or not dark darks and bright brights are allowed in the data vs. used as signaling (like a new frame starting), right?

      • As far as CICP size (4 vs. 7 bytes), I will continue to read H.273 once my power is restored. I don't have a print out.

    To view, visit change 3705739. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ia7717f161bd1569691e07c9216957814f2c073f0
    Gerrit-Change-Number: 3705739
    Gerrit-PatchSet: 3
    Gerrit-Owner: Luca Versari <vel...@google.com>
    Gerrit-Reviewer: Peter Kasting <pkas...@chromium.org>
    Gerrit-Reviewer: Wan-Teh Chang <w...@google.com>
    Gerrit-CC: Chris Blume <cbl...@chromium.org>
    Gerrit-CC: Dale Curtis <dalec...@chromium.org>
    Gerrit-CC: Eugene Kliuchnikov <eus...@chromium.org>
    Gerrit-CC: Moritz Firsching <firs...@google.com>
    Gerrit-CC: Sami Boukortt <sbou...@google.com>
    Gerrit-Attention: Luca Versari <vel...@google.com>
    Gerrit-Attention: Chris Blume <cbl...@chromium.org>
    Gerrit-Attention: Eugene Kliuchnikov <eus...@chromium.org>
    Gerrit-Comment-Date: Wed, 15 Jun 2022 17:35:19 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Gerrit-MessageType: comment

    Chris Blume

    unread,
    Jun 15, 2022, 1:35:51 PM6/15/22
    to change-...@chromium-review.googlesource.com, Luca Versari, blink-...@chromium.org, cblume+im...@chromium.org, kinuko...@chromium.org, mbarowsky+watc...@chromium.org, Wan-Teh Chang, Moritz Firsching, Eugene Kliuchnikov, Sami Boukortt, Peter Kasting, chromium...@chromium.org
    Sorry, I meant to say the link is coincidence, not causal.

    Chris Blume (Gerrit)

    unread,
    Jun 15, 2022, 1:36:04 PM6/15/22
    to Luca Versari, blink-...@chromium.org, cblume+im...@chromium.org, kinuko...@chromium.org, mbarowsky+watc...@chromium.org, Wan-Teh Chang, Moritz Firsching, Eugene Kliuchnikov, Sami Boukortt, Peter Kasting, Dale Curtis, chromium...@chromium.org

    Attention is currently required from: Chris Blume, Eugene Kliuchnikov, Luca Versari.

    Sorry, I meant to say the link is coincidence, not causal.

    View Change

    1 comment:

    • Patchset:

      • Patch Set #3:

        Sorry, I meant to say the link is coincidence, not causal.

    To view, visit change 3705739. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ia7717f161bd1569691e07c9216957814f2c073f0
    Gerrit-Change-Number: 3705739
    Gerrit-PatchSet: 3
    Gerrit-Owner: Luca Versari <vel...@google.com>
    Gerrit-Reviewer: Peter Kasting <pkas...@chromium.org>
    Gerrit-Reviewer: Wan-Teh Chang <w...@google.com>
    Gerrit-CC: Chris Blume <cbl...@chromium.org>
    Gerrit-CC: Dale Curtis <dalec...@chromium.org>
    Gerrit-CC: Eugene Kliuchnikov <eus...@chromium.org>
    Gerrit-CC: Moritz Firsching <firs...@google.com>
    Gerrit-CC: Sami Boukortt <sbou...@google.com>
    Gerrit-Attention: Luca Versari <vel...@google.com>
    Gerrit-Attention: Chris Blume <cbl...@chromium.org>
    Gerrit-Attention: Eugene Kliuchnikov <eus...@chromium.org>
    Gerrit-Comment-Date: Wed, 15 Jun 2022 17:35:51 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Gerrit-MessageType: comment

    Dale Curtis (Gerrit)

    unread,
    Jun 15, 2022, 1:48:16 PM6/15/22
    to Luca Versari, blink-...@chromium.org, cblume+im...@chromium.org, kinuko...@chromium.org, mbarowsky+watc...@chromium.org, Wan-Teh Chang, Moritz Firsching, Chris Blume, Eugene Kliuchnikov, Sami Boukortt, Peter Kasting, chromium...@chromium.org

    Attention is currently required from: Chris Blume, Eugene Kliuchnikov, Luca Versari.

    View Change

    1 comment:

    • Patchset:

      • Patch Set #3:

        I think the link between YUV and limited range is causal. […]

        Kind of, limited means the signal values are [16, 235] and full means [0, 255] -- we expand limited to full for display, so they will look the same. There's nothing that stops a container from lying about the range though as the color values are not generally checked.

        Certainly limited range RGB can be constructed, it's uncommon though. If it's intended to be part of the spec the code should eventually support it.

        However, if they can't be created by any current tooling the priority of doing so in this CL versus a followup leans more towards the followup side (since it's complicated). (Which is the only point I'm trying to make)

    To view, visit change 3705739. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ia7717f161bd1569691e07c9216957814f2c073f0
    Gerrit-Change-Number: 3705739
    Gerrit-PatchSet: 3
    Gerrit-Owner: Luca Versari <vel...@google.com>
    Gerrit-Reviewer: Peter Kasting <pkas...@chromium.org>
    Gerrit-Reviewer: Wan-Teh Chang <w...@google.com>
    Gerrit-CC: Chris Blume <cbl...@chromium.org>
    Gerrit-CC: Dale Curtis <dalec...@chromium.org>
    Gerrit-CC: Eugene Kliuchnikov <eus...@chromium.org>
    Gerrit-CC: Moritz Firsching <firs...@google.com>
    Gerrit-CC: Sami Boukortt <sbou...@google.com>
    Gerrit-Attention: Luca Versari <vel...@google.com>
    Gerrit-Attention: Chris Blume <cbl...@chromium.org>
    Gerrit-Attention: Eugene Kliuchnikov <eus...@chromium.org>
    Gerrit-Comment-Date: Wed, 15 Jun 2022 17:48:07 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No

    Chris Blume

    unread,
    Jun 15, 2022, 1:54:51 PM6/15/22
    to change-...@chromium-review.googlesource.com, Luca Versari, blink-...@chromium.org, cblume+im...@chromium.org, kinuko...@chromium.org, mbarowsky+watc...@chromium.org, Wan-Teh Chang, Moritz Firsching, Eugene Kliuchnikov, Sami Boukortt, Peter Kasting, chromium...@chromium.org
    Got ya.

    If treating the image as full means it does not get expanded, that would mean no signal values are accidentally generated. So I think it is fine for now to always treat it as full and not expand.

    I do know BBC has tooling and PNGs to test limited range. But
    1.) This isn't normal. Normal web users won't see that for a long, long time. And
    2.) If we aren't expanding values yet anyway, it should be fine.

    Chris Blume (Gerrit)

    unread,
    Jun 15, 2022, 1:55:11 PM6/15/22
    to Luca Versari, blink-...@chromium.org, cblume+im...@chromium.org, kinuko...@chromium.org, mbarowsky+watc...@chromium.org, Wan-Teh Chang, Moritz Firsching, Eugene Kliuchnikov, Sami Boukortt, Peter Kasting, Dale Curtis, chromium...@chromium.org

    Attention is currently required from: Chris Blume, Eugene Kliuchnikov, Luca Versari.

    Got ya.

    If treating the image as full means it does not get expanded, that would mean no signal values are accidentally generated. So I think it is fine for now to always treat it as full and not expand.

    I do know BBC has tooling and PNGs to test limited range. But

    1.) This isn't normal. Normal web users won't see that for a long, long time. And

    2.) If we aren't expanding values yet anyway, it should be fine.

    View Change

    1 comment:

      • If treating the image as full means it does not get expanded, that would mean no signal values are accidentally generated. So I think it is fine for now to always treat it as full and not expand.

        I do know BBC has tooling and PNGs to test limited range. But

        1.) This isn't normal. Normal web users won't see that for a long, long time. And

        2.) If we aren't expanding values yet anyway, it should be fine.

    To view, visit change 3705739. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ia7717f161bd1569691e07c9216957814f2c073f0
    Gerrit-Change-Number: 3705739
    Gerrit-PatchSet: 3
    Gerrit-Owner: Luca Versari <vel...@google.com>
    Gerrit-Reviewer: Peter Kasting <pkas...@chromium.org>
    Gerrit-Reviewer: Wan-Teh Chang <w...@google.com>
    Gerrit-CC: Chris Blume <cbl...@chromium.org>
    Gerrit-CC: Dale Curtis <dalec...@chromium.org>
    Gerrit-CC: Eugene Kliuchnikov <eus...@chromium.org>
    Gerrit-CC: Moritz Firsching <firs...@google.com>
    Gerrit-CC: Sami Boukortt <sbou...@google.com>
    Gerrit-Attention: Luca Versari <vel...@google.com>
    Gerrit-Attention: Chris Blume <cbl...@chromium.org>
    Gerrit-Attention: Eugene Kliuchnikov <eus...@chromium.org>
    Gerrit-Comment-Date: Wed, 15 Jun 2022 17:54:56 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Gerrit-MessageType: comment

    Luca Versari (Gerrit)

    unread,
    Jun 15, 2022, 3:06:02 PM6/15/22
    to blink-...@chromium.org, cblume+im...@chromium.org, kinuko...@chromium.org, mbarowsky+watc...@chromium.org, Wan-Teh Chang, Moritz Firsching, Chris Blume, Eugene Kliuchnikov, Sami Boukortt, Peter Kasting, Dale Curtis, chromium...@chromium.org

    Attention is currently required from: Chris Blume, Dale Curtis, Eugene Kliuchnikov, Wan-Teh Chang.

    View Change

    12 comments:

    • Patchset:

      • Patch Set #3:

        Kind of, limited means the signal values are [16, 235] and full means [0, 255] -- we expand limited […]

        Ack

      • Patch Set #3:

        Yes limited range is extremely common in video contexts. […]

        Ack

    • File third_party/blink/renderer/platform/image-decoders/png/png_image_decoder.cc:

      • Are you able to construct a limited range RGB PNG using any tooling today? […]

        Added a warning.

    • File third_party/blink/renderer/platform/image-decoders/png/png_image_decoder.cc:

      • Done

      • IMPORTANT: We should link to the spec. It's okay to link to a draft of the spec. […]

        I propose that we wait to submit this CL until the conversation at https://github.com/w3c/PNG-spec/issues/129 reaches a conclusion.

      • Done

      • Done

      • Done

      • IMPORTANT: This should be `chunk.data[3]`. […]

        Ups, I got that wrong when addressing previous comments. Done.

      • Done

      • Done

    • File third_party/blink/renderer/platform/image-decoders/png/png_image_reader.cc:

      • Ah, it wasn't clear to me from the PNG doc that the macro was defined. Done.

    To view, visit change 3705739. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ia7717f161bd1569691e07c9216957814f2c073f0
    Gerrit-Change-Number: 3705739
    Gerrit-PatchSet: 4
    Gerrit-Owner: Luca Versari <vel...@google.com>
    Gerrit-Reviewer: Peter Kasting <pkas...@chromium.org>
    Gerrit-Reviewer: Wan-Teh Chang <w...@google.com>
    Gerrit-CC: Chris Blume <cbl...@chromium.org>
    Gerrit-CC: Dale Curtis <dalec...@chromium.org>
    Gerrit-CC: Eugene Kliuchnikov <eus...@chromium.org>
    Gerrit-CC: Moritz Firsching <firs...@google.com>
    Gerrit-CC: Sami Boukortt <sbou...@google.com>
    Gerrit-Attention: Dale Curtis <dalec...@chromium.org>
    Gerrit-Attention: Chris Blume <cbl...@chromium.org>
    Gerrit-Attention: Wan-Teh Chang <w...@google.com>
    Gerrit-Attention: Eugene Kliuchnikov <eus...@chromium.org>
    Gerrit-Comment-Date: Wed, 15 Jun 2022 19:05:48 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Dale Curtis <dalec...@chromium.org>
    Comment-In-Reply-To: Chris Blume <cbl...@chromium.org>
    Comment-In-Reply-To: Luca Versari <vel...@google.com>
    Comment-In-Reply-To: Wan-Teh Chang <w...@google.com>
    Gerrit-MessageType: comment

    Dale Curtis (Gerrit)

    unread,
    Jun 15, 2022, 3:59:03 PM6/15/22
    to Luca Versari, blink-...@chromium.org, cblume+im...@chromium.org, kinuko...@chromium.org, mbarowsky+watc...@chromium.org, Wan-Teh Chang, Moritz Firsching, Chris Blume, Eugene Kliuchnikov, Sami Boukortt, Peter Kasting, chromium...@chromium.org

    Attention is currently required from: Chris Blume, Eugene Kliuchnikov, Luca Versari, Wan-Teh Chang.

    View Change

    1 comment:

    • File third_party/blink/renderer/platform/image-decoders/png/png_image_decoder.cc:

    To view, visit change 3705739. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ia7717f161bd1569691e07c9216957814f2c073f0
    Gerrit-Change-Number: 3705739
    Gerrit-PatchSet: 4
    Gerrit-Owner: Luca Versari <vel...@google.com>
    Gerrit-Reviewer: Peter Kasting <pkas...@chromium.org>
    Gerrit-Reviewer: Wan-Teh Chang <w...@google.com>
    Gerrit-CC: Chris Blume <cbl...@chromium.org>
    Gerrit-CC: Dale Curtis <dalec...@chromium.org>
    Gerrit-CC: Eugene Kliuchnikov <eus...@chromium.org>
    Gerrit-CC: Moritz Firsching <firs...@google.com>
    Gerrit-CC: Sami Boukortt <sbou...@google.com>
    Gerrit-Attention: Luca Versari <vel...@google.com>
    Gerrit-Attention: Chris Blume <cbl...@chromium.org>
    Gerrit-Attention: Wan-Teh Chang <w...@google.com>
    Gerrit-Attention: Eugene Kliuchnikov <eus...@chromium.org>
    Gerrit-Comment-Date: Wed, 15 Jun 2022 19:58:54 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Gerrit-MessageType: comment

    Chris Blume

    unread,
    Jun 15, 2022, 4:11:10 PM6/15/22
    to change-...@chromium-review.googlesource.com, Luca Versari, blink-...@chromium.org, cblume+im...@chromium.org, kinuko...@chromium.org, mbarowsky+watc...@chromium.org, Wan-Teh Chang, Moritz Firsching, Eugene Kliuchnikov, Sami Boukortt, Peter Kasting, chromium...@chromium.org
    Yes, CICP should be preferred over ICC. This was agreed upon by the Color for the Web Community Group.

    With the exception of when we know the display/surface do not support the desired code point. Then it should ignore the cICP chunk and continue down the list of priorities.

    (I believe it is okay to say "I don't know if it is supported or not. I'll assume so.")

    Chris Blume (Gerrit)

    unread,
    Jun 15, 2022, 4:11:19 PM6/15/22
    to Luca Versari, blink-...@chromium.org, cblume+im...@chromium.org, kinuko...@chromium.org, mbarowsky+watc...@chromium.org, Wan-Teh Chang, Moritz Firsching, Eugene Kliuchnikov, Sami Boukortt, Peter Kasting, Dale Curtis, chromium...@chromium.org

    Attention is currently required from: Chris Blume, Eugene Kliuchnikov, Luca Versari, Wan-Teh Chang.

    Yes, CICP should be preferred over ICC. This was agreed upon by the Color for the Web Community Group.

    With the exception of when we know the display/surface do not support the desired code point. Then it should ignore the cICP chunk and continue down the list of priorities.

    (I believe it is okay to say "I don't know if it is supported or not. I'll assume so.")

    View Change

    1 comment:

      • Yes, CICP should be preferred over ICC. This was agreed upon by the Color for the Web Community Group.

        With the exception of when we know the display/surface do not support the desired code point. Then it should ignore the cICP chunk and continue down the list of priorities.

        (I believe it is okay to say "I don't know if it is supported or not. I'll assume so.")

    To view, visit change 3705739. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ia7717f161bd1569691e07c9216957814f2c073f0
    Gerrit-Change-Number: 3705739
    Gerrit-PatchSet: 4
    Gerrit-Owner: Luca Versari <vel...@google.com>
    Gerrit-Reviewer: Peter Kasting <pkas...@chromium.org>
    Gerrit-Reviewer: Wan-Teh Chang <w...@google.com>
    Gerrit-CC: Chris Blume <cbl...@chromium.org>
    Gerrit-CC: Dale Curtis <dalec...@chromium.org>
    Gerrit-CC: Eugene Kliuchnikov <eus...@chromium.org>
    Gerrit-CC: Moritz Firsching <firs...@google.com>
    Gerrit-CC: Sami Boukortt <sbou...@google.com>
    Gerrit-Attention: Luca Versari <vel...@google.com>
    Gerrit-Attention: Chris Blume <cbl...@chromium.org>
    Gerrit-Attention: Wan-Teh Chang <w...@google.com>
    Gerrit-Attention: Eugene Kliuchnikov <eus...@chromium.org>
    Gerrit-Comment-Date: Wed, 15 Jun 2022 20:11:10 +0000

    Luca Versari (Gerrit)

    unread,
    Jun 15, 2022, 4:38:53 PM6/15/22
    to blink-...@chromium.org, cblume+im...@chromium.org, kinuko...@chromium.org, mbarowsky+watc...@chromium.org, Wan-Teh Chang, Moritz Firsching, Chris Blume, Eugene Kliuchnikov, Sami Boukortt, Peter Kasting, Dale Curtis, chromium...@chromium.org

    Attention is currently required from: Chris Blume, Dale Curtis, Eugene Kliuchnikov, Wan-Teh Chang.

    View Change

    2 comments:

    • Patchset:

      • Patch Set #4:

        Yes, CICP should be preferred over ICC. […]

        If I understand the semantics of the construction of a ColorSpace correctly, cICP specifying an unsupported-by-chrome configuration will result in the cICP chunk being ignored, which I believe implements exactly these semantics.

    • File third_party/blink/renderer/platform/image-decoders/png/png_image_decoder.cc:

      • Ack

    To view, visit change 3705739. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ia7717f161bd1569691e07c9216957814f2c073f0
    Gerrit-Change-Number: 3705739
    Gerrit-PatchSet: 4
    Gerrit-Owner: Luca Versari <vel...@google.com>
    Gerrit-Reviewer: Peter Kasting <pkas...@chromium.org>
    Gerrit-Reviewer: Wan-Teh Chang <w...@google.com>
    Gerrit-CC: Chris Blume <cbl...@chromium.org>
    Gerrit-CC: Dale Curtis <dalec...@chromium.org>
    Gerrit-CC: Eugene Kliuchnikov <eus...@chromium.org>
    Gerrit-CC: Moritz Firsching <firs...@google.com>
    Gerrit-CC: Sami Boukortt <sbou...@google.com>
    Gerrit-Attention: Dale Curtis <dalec...@chromium.org>
    Gerrit-Attention: Chris Blume <cbl...@chromium.org>
    Gerrit-Attention: Wan-Teh Chang <w...@google.com>
    Gerrit-Attention: Eugene Kliuchnikov <eus...@chromium.org>
    Gerrit-Comment-Date: Wed, 15 Jun 2022 20:38:41 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Dale Curtis <dalec...@chromium.org>
    Comment-In-Reply-To: Chris Blume <cbl...@chromium.org>
    Gerrit-MessageType: comment

    Wan-Teh Chang (Gerrit)

    unread,
    Jun 16, 2022, 5:28:02 PM6/16/22
    to Luca Versari, blink-...@chromium.org, cblume+im...@chromium.org, kinuko...@chromium.org, mbarowsky+watc...@chromium.org, Wan-Teh Chang, Moritz Firsching, Chris Blume, Eugene Kliuchnikov, Sami Boukortt, Peter Kasting, Dale Curtis, chromium...@chromium.org

    Attention is currently required from: Chris Blume, Eugene Kliuchnikov, Luca Versari.

    Patch set 4:Code-Review -1

    View Change

    2 comments:

    • File third_party/blink/renderer/platform/image-decoders/png/png_image_decoder.cc:

      • Patch Set #4, Line 165:

          if (strcmp(reinterpret_cast<const char*>(chunk.name), "cICP") != 0) {
        return nullptr;
        }

        I suggest we move these three lines (165-167) back to the caller (with modification, see my comment at line 222). Then, if this function returns nullptr, it means we have an invalid cICP chunk, and the caller can choose to handle that as an error rather than ignore it.

      • Patch Set #4, Line 218:

            std::unique_ptr<ColorProfile> cicp_color_profile =
        ParseCicpChunk(unknown_chunks[i]);
        if (cicp_color_profile) {
        return cicp_color_profile;
        }

        Please see my comment at line 167.

        I suggest we rewrite the for loop's body as follows:

        ```

      • const auto& chunk = unknown_chunks[i];
      •     if (strcmp(reinterpret_cast<const char*>(chunk.name), "cICP") == 0) {
        return ParseCicpChunk(chunk);
        }
        ```

        Note that this treats an invalid cICP chunk as an error. You can tweak this if you want to silently ignore an invalid cICP chunk.

    To view, visit change 3705739. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ia7717f161bd1569691e07c9216957814f2c073f0
    Gerrit-Change-Number: 3705739
    Gerrit-PatchSet: 4
    Gerrit-Owner: Luca Versari <vel...@google.com>
    Gerrit-Reviewer: Peter Kasting <pkas...@chromium.org>
    Gerrit-Reviewer: Wan-Teh Chang <w...@google.com>
    Gerrit-CC: Chris Blume <cbl...@chromium.org>
    Gerrit-CC: Dale Curtis <dalec...@chromium.org>
    Gerrit-CC: Eugene Kliuchnikov <eus...@chromium.org>
    Gerrit-CC: Moritz Firsching <firs...@google.com>
    Gerrit-CC: Sami Boukortt <sbou...@google.com>
    Gerrit-Attention: Luca Versari <vel...@google.com>
    Gerrit-Attention: Chris Blume <cbl...@chromium.org>
    Gerrit-Attention: Eugene Kliuchnikov <eus...@chromium.org>
    Gerrit-Comment-Date: Thu, 16 Jun 2022 21:27:25 +0000

    Chris Blume (Gerrit)

    unread,
    Jun 17, 2022, 8:46:22 PM6/17/22
    to Luca Versari, blink-...@chromium.org, cblume+im...@chromium.org, kinuko...@chromium.org, mbarowsky+watc...@chromium.org, Wan-Teh Chang, Moritz Firsching, Eugene Kliuchnikov, Sami Boukortt, Peter Kasting, Dale Curtis, chromium...@chromium.org

    Attention is currently required from: Eugene Kliuchnikov, Luca Versari.

    View Change

    1 comment:

    To view, visit change 3705739. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ia7717f161bd1569691e07c9216957814f2c073f0
    Gerrit-Change-Number: 3705739
    Gerrit-PatchSet: 4
    Gerrit-Owner: Luca Versari <vel...@google.com>
    Gerrit-Reviewer: Peter Kasting <pkas...@chromium.org>
    Gerrit-Reviewer: Wan-Teh Chang <w...@google.com>
    Gerrit-CC: Chris Blume <cbl...@chromium.org>
    Gerrit-CC: Dale Curtis <dalec...@chromium.org>
    Gerrit-CC: Eugene Kliuchnikov <eus...@chromium.org>
    Gerrit-CC: Moritz Firsching <firs...@google.com>
    Gerrit-CC: Sami Boukortt <sbou...@google.com>
    Gerrit-Attention: Luca Versari <vel...@google.com>
    Gerrit-Attention: Eugene Kliuchnikov <eus...@chromium.org>
    Gerrit-Comment-Date: Sat, 18 Jun 2022 00:46:13 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Gerrit-MessageType: comment

    Luca Versari (Gerrit)

    unread,
    Jun 21, 2022, 1:56:49 PM6/21/22
    to blink-...@chromium.org, cblume+im...@chromium.org, kinuko...@chromium.org, mbarowsky+watc...@chromium.org, Wan-Teh Chang, Moritz Firsching, Chris Blume, Eugene Kliuchnikov, Sami Boukortt, Peter Kasting, Dale Curtis, chromium...@chromium.org

    Attention is currently required from: Eugene Kliuchnikov, Wan-Teh Chang.

    View Change

    3 comments:

    • Patchset:

    • File third_party/blink/renderer/platform/image-decoders/png/png_image_decoder.cc:

      • I suggest we move these three lines (165-167) back to the caller (with modification, see my comment […]

        Done

      • Patch Set #4, Line 218:

            std::unique_ptr<ColorProfile> cicp_color_profile =
        ParseCicpChunk(unknown_chunks[i]);
        if (cicp_color_profile) {
        return cicp_color_profile;
        }

      • Please see my comment at line 167. […]

        Done

    To view, visit change 3705739. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ia7717f161bd1569691e07c9216957814f2c073f0
    Gerrit-Change-Number: 3705739
    Gerrit-PatchSet: 4
    Gerrit-Owner: Luca Versari <vel...@google.com>
    Gerrit-Reviewer: Peter Kasting <pkas...@chromium.org>
    Gerrit-Reviewer: Wan-Teh Chang <w...@google.com>
    Gerrit-CC: Chris Blume <cbl...@chromium.org>
    Gerrit-CC: Dale Curtis <dalec...@chromium.org>
    Gerrit-CC: Eugene Kliuchnikov <eus...@chromium.org>
    Gerrit-CC: Moritz Firsching <firs...@google.com>
    Gerrit-CC: Sami Boukortt <sbou...@google.com>
    Gerrit-Attention: Wan-Teh Chang <w...@google.com>
    Gerrit-Attention: Eugene Kliuchnikov <eus...@chromium.org>
    Gerrit-Comment-Date: Tue, 21 Jun 2022 17:56:41 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No

    Wan-Teh Chang (Gerrit)

    unread,
    Jun 22, 2022, 2:55:29 PM6/22/22
    to Luca Versari, blink-...@chromium.org, cblume+im...@chromium.org, kinuko...@chromium.org, mbarowsky+watc...@chromium.org, Wan-Teh Chang, Moritz Firsching, Chris Blume, Eugene Kliuchnikov, Sami Boukortt, Peter Kasting, Dale Curtis, chromium...@chromium.org

    Attention is currently required from: Eugene Kliuchnikov, Luca Versari.

    Patch set 5:Code-Review +1

    View Change

    1 comment:

    • File third_party/blink/renderer/platform/image-decoders/png/png_image_decoder.cc:

      • Patch Set #5, Line 163: // Returns nullptr if the cICP chunk is invalid.

        Nit: Add "if the color profile it describes is not supported"? See the comment at line 219.

    To view, visit change 3705739. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ia7717f161bd1569691e07c9216957814f2c073f0
    Gerrit-Change-Number: 3705739
    Gerrit-PatchSet: 5
    Gerrit-Owner: Luca Versari <vel...@google.com>
    Gerrit-Reviewer: Peter Kasting <pkas...@chromium.org>
    Gerrit-Reviewer: Wan-Teh Chang <w...@google.com>
    Gerrit-CC: Chris Blume <cbl...@chromium.org>
    Gerrit-CC: Dale Curtis <dalec...@chromium.org>
    Gerrit-CC: Eugene Kliuchnikov <eus...@chromium.org>
    Gerrit-CC: Moritz Firsching <firs...@google.com>
    Gerrit-CC: Sami Boukortt <sbou...@google.com>
    Gerrit-Attention: Luca Versari <vel...@google.com>
    Gerrit-Attention: Eugene Kliuchnikov <eus...@chromium.org>
    Gerrit-Comment-Date: Wed, 22 Jun 2022 18:55:22 +0000

    Luca Versari (Gerrit)

    unread,
    Jun 22, 2022, 4:20:02 PM6/22/22
    to blink-...@chromium.org, cblume+im...@chromium.org, kinuko...@chromium.org, mbarowsky+watc...@chromium.org, Wan-Teh Chang, Moritz Firsching, Chris Blume, Eugene Kliuchnikov, Sami Boukortt, Peter Kasting, Dale Curtis, chromium...@chromium.org

    Attention is currently required from: Eugene Kliuchnikov.

    View Change

    1 comment:

    • File third_party/blink/renderer/platform/image-decoders/png/png_image_decoder.cc:

      • Patch Set #5, Line 163: // Returns nullptr if the cICP chunk is invalid.

        Nit: Add "if the color profile it describes is not supported"? See the comment at line 219.

      • Done

    To view, visit change 3705739. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ia7717f161bd1569691e07c9216957814f2c073f0
    Gerrit-Change-Number: 3705739
    Gerrit-PatchSet: 5
    Gerrit-Owner: Luca Versari <vel...@google.com>
    Gerrit-Reviewer: Peter Kasting <pkas...@chromium.org>
    Gerrit-Reviewer: Wan-Teh Chang <w...@google.com>
    Gerrit-CC: Chris Blume <cbl...@chromium.org>
    Gerrit-CC: Dale Curtis <dalec...@chromium.org>
    Gerrit-CC: Eugene Kliuchnikov <eus...@chromium.org>
    Gerrit-CC: Moritz Firsching <firs...@google.com>
    Gerrit-CC: Sami Boukortt <sbou...@google.com>
    Gerrit-Attention: Eugene Kliuchnikov <eus...@chromium.org>
    Gerrit-Comment-Date: Wed, 22 Jun 2022 20:19:46 +0000

    Wan-Teh Chang (Gerrit)

    unread,
    Jun 22, 2022, 4:32:53 PM6/22/22
    to Luca Versari, blink-...@chromium.org, cblume+im...@chromium.org, kinuko...@chromium.org, mbarowsky+watc...@chromium.org, Wan-Teh Chang, Moritz Firsching, Chris Blume, Eugene Kliuchnikov, Sami Boukortt, Peter Kasting, Dale Curtis, chromium...@chromium.org

    Attention is currently required from: Eugene Kliuchnikov, Luca Versari.

    Patch set 6:Code-Review +1

    View Change

    1 comment:

    To view, visit change 3705739. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ia7717f161bd1569691e07c9216957814f2c073f0
    Gerrit-Change-Number: 3705739
    Gerrit-PatchSet: 6
    Gerrit-Owner: Luca Versari <vel...@google.com>
    Gerrit-Reviewer: Peter Kasting <pkas...@chromium.org>
    Gerrit-Reviewer: Wan-Teh Chang <w...@google.com>
    Gerrit-CC: Chris Blume <cbl...@chromium.org>
    Gerrit-CC: Dale Curtis <dalec...@chromium.org>
    Gerrit-CC: Eugene Kliuchnikov <eus...@chromium.org>
    Gerrit-CC: Moritz Firsching <firs...@google.com>
    Gerrit-CC: Sami Boukortt <sbou...@google.com>
    Gerrit-Attention: Luca Versari <vel...@google.com>
    Gerrit-Attention: Eugene Kliuchnikov <eus...@chromium.org>
    Gerrit-Comment-Date: Wed, 22 Jun 2022 20:32:45 +0000

    Luca Versari (Gerrit)

    unread,
    Jun 23, 2022, 12:11:50 PM6/23/22
    to blink-...@chromium.org, cblume+im...@chromium.org, kinuko...@chromium.org, mbarowsky+watc...@chromium.org, Wan-Teh Chang, Moritz Firsching, Chris Blume, Eugene Kliuchnikov, Sami Boukortt, Peter Kasting, Dale Curtis, chromium...@chromium.org

    Attention is currently required from: Eugene Kliuchnikov.

    View Change

    1 comment:

    • File third_party/blink/renderer/platform/image-decoders/png/png_image_decoder.cc:

      • Patch Set #3, Line 176: // cICP must be 4 bytes.

        I propose that we wait to submit this CL until the conversation at https://github. […]

        I added the link, and the linked issue was resolved.

    To view, visit change 3705739. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ia7717f161bd1569691e07c9216957814f2c073f0
    Gerrit-Change-Number: 3705739
    Gerrit-PatchSet: 7
    Gerrit-Owner: Luca Versari <vel...@google.com>
    Gerrit-Reviewer: Peter Kasting <pkas...@chromium.org>
    Gerrit-Reviewer: Wan-Teh Chang <w...@google.com>
    Gerrit-CC: Chris Blume <cbl...@chromium.org>
    Gerrit-CC: Dale Curtis <dalec...@chromium.org>
    Gerrit-CC: Eugene Kliuchnikov <eus...@chromium.org>
    Gerrit-CC: Moritz Firsching <firs...@google.com>
    Gerrit-CC: Sami Boukortt <sbou...@google.com>
    Gerrit-Attention: Eugene Kliuchnikov <eus...@chromium.org>
    Gerrit-Comment-Date: Thu, 23 Jun 2022 16:11:43 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Luca Versari <vel...@google.com>

    Wan-Teh Chang (Gerrit)

    unread,
    Jun 23, 2022, 12:38:46 PM6/23/22
    to Luca Versari, blink-...@chromium.org, cblume+im...@chromium.org, kinuko...@chromium.org, mbarowsky+watc...@chromium.org, Wan-Teh Chang, Moritz Firsching, Chris Blume, Eugene Kliuchnikov, Sami Boukortt, Peter Kasting, Dale Curtis, chromium...@chromium.org

    Attention is currently required from: Eugene Kliuchnikov, Luca Versari, Peter Kasting.

    Patch set 7:Code-Review +1

    View Change

    1 comment:

    • Patchset:

      • Patch Set #7:

        LGTM.

        Peter, would you like to take another look at this CL?

    To view, visit change 3705739. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ia7717f161bd1569691e07c9216957814f2c073f0
    Gerrit-Change-Number: 3705739
    Gerrit-PatchSet: 7
    Gerrit-Owner: Luca Versari <vel...@google.com>
    Gerrit-Reviewer: Peter Kasting <pkas...@chromium.org>
    Gerrit-Reviewer: Wan-Teh Chang <w...@google.com>
    Gerrit-CC: Chris Blume <cbl...@chromium.org>
    Gerrit-CC: Dale Curtis <dalec...@chromium.org>
    Gerrit-CC: Eugene Kliuchnikov <eus...@chromium.org>
    Gerrit-CC: Moritz Firsching <firs...@google.com>
    Gerrit-CC: Sami Boukortt <sbou...@google.com>
    Gerrit-Attention: Luca Versari <vel...@google.com>
    Gerrit-Attention: Peter Kasting <pkas...@chromium.org>
    Gerrit-Attention: Eugene Kliuchnikov <eus...@chromium.org>
    Gerrit-Comment-Date: Thu, 23 Jun 2022 16:38:38 +0000

    Peter Kasting (Gerrit)

    unread,
    Jun 23, 2022, 2:19:53 PM6/23/22
    to Luca Versari, blink-...@chromium.org, cblume+im...@chromium.org, kinuko...@chromium.org, mbarowsky+watc...@chromium.org, Wan-Teh Chang, Moritz Firsching, Chris Blume, Eugene Kliuchnikov, Sami Boukortt, Dale Curtis, chromium...@chromium.org

    Attention is currently required from: Eugene Kliuchnikov, Luca Versari.

    Patch set 7:Code-Review +1

    View Change

    4 comments:

    • Patchset:

    • File third_party/blink/renderer/platform/image-decoders/png/png_image_decoder.cc:

      • Patch Set #7, Line 166: inline std::unique_ptr<ColorProfile> ParseCicpChunk(

        Does this really need to be marked inline?

        Also, if this is a file-scope function, can we define in an anonymous namespace atop the file?

      • Patch Set #7, Line 194: DLOG(WARNING) << "Limited range RGB is not fully supported";

        Is there a bug on this we can reference in a TODO?

      • Patch Set #7, Line 223: if (!cicp_color_profile) {

        Nit: Seems like this would be clearer as:

          if (cicp_color_profile)
        return cicp_color_profile;

    To view, visit change 3705739. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ia7717f161bd1569691e07c9216957814f2c073f0
    Gerrit-Change-Number: 3705739
    Gerrit-PatchSet: 7
    Gerrit-Owner: Luca Versari <vel...@google.com>
    Gerrit-Reviewer: Peter Kasting <pkas...@chromium.org>
    Gerrit-Reviewer: Wan-Teh Chang <w...@google.com>
    Gerrit-CC: Chris Blume <cbl...@chromium.org>
    Gerrit-CC: Dale Curtis <dalec...@chromium.org>
    Gerrit-CC: Eugene Kliuchnikov <eus...@chromium.org>
    Gerrit-CC: Moritz Firsching <firs...@google.com>
    Gerrit-CC: Sami Boukortt <sbou...@google.com>
    Gerrit-Attention: Luca Versari <vel...@google.com>
    Gerrit-Attention: Eugene Kliuchnikov <eus...@chromium.org>
    Gerrit-Comment-Date: Thu, 23 Jun 2022 18:19:45 +0000

    Luca Versari (Gerrit)

    unread,
    Jun 23, 2022, 2:39:33 PM6/23/22
    to blink-...@chromium.org, cblume+im...@chromium.org, kinuko...@chromium.org, mbarowsky+watc...@chromium.org, Wan-Teh Chang, Moritz Firsching, Chris Blume, Eugene Kliuchnikov, Sami Boukortt, Peter Kasting, Dale Curtis, chromium...@chromium.org

    Attention is currently required from: Eugene Kliuchnikov.

    View Change

    3 comments:

    • File third_party/blink/renderer/platform/image-decoders/png/png_image_decoder.cc:

      • Does this really need to be marked inline? […]

        Done. FWIW, the function was `inline` because `ReadColorProfile` was `inline`.

      • Patch Set #7, Line 194: DLOG(WARNING) << "Limited range RGB is not fully supported";

        Is there a bug on this we can reference in a TODO?

      • Done

      • Nit: Seems like this would be clearer as: […]

        Done

    To view, visit change 3705739. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ia7717f161bd1569691e07c9216957814f2c073f0
    Gerrit-Change-Number: 3705739
    Gerrit-PatchSet: 7
    Gerrit-Owner: Luca Versari <vel...@google.com>
    Gerrit-Reviewer: Peter Kasting <pkas...@chromium.org>
    Gerrit-Reviewer: Wan-Teh Chang <w...@google.com>
    Gerrit-CC: Chris Blume <cbl...@chromium.org>
    Gerrit-CC: Dale Curtis <dalec...@chromium.org>
    Gerrit-CC: Eugene Kliuchnikov <eus...@chromium.org>
    Gerrit-CC: Moritz Firsching <firs...@google.com>
    Gerrit-CC: Sami Boukortt <sbou...@google.com>
    Gerrit-Attention: Eugene Kliuchnikov <eus...@chromium.org>
    Gerrit-Comment-Date: Thu, 23 Jun 2022 18:39:22 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Peter Kasting <pkas...@chromium.org>
    Gerrit-MessageType: comment

    Wan-Teh Chang (Gerrit)

    unread,
    Jun 23, 2022, 2:59:59 PM6/23/22
    to Luca Versari, blink-...@chromium.org, cblume+im...@chromium.org, kinuko...@chromium.org, mbarowsky+watc...@chromium.org, Wan-Teh Chang, Moritz Firsching, Chris Blume, Eugene Kliuchnikov, Sami Boukortt, Peter Kasting, Dale Curtis, chromium...@chromium.org

    Attention is currently required from: Eugene Kliuchnikov, Luca Versari.

    Patch set 8:Code-Review +1

    View Change

    4 comments:

    • File third_party/blink/renderer/platform/image-decoders/png/png_image_decoder.cc:

      • Patch Set #8, Line 54: namespace {

        Existing code uses `static` to mark file-scope functions. I wonder if we should also just declare ParseCicpChunk() as static for consistency.

      • Patch Set #8, Line 102: } // namespace

        Nit: I suggest adding a blank line after line 54 and before this line, like so:

        ```
        namespace {

        // Returns nullptr if the cICP chunk is invalid, or if it describes an
        // unsupported color profile.
        // See https://w3c.github.io/PNG-spec/#11cICP for the definition of this chunk.
        std::unique_ptr<ColorProfile> ParseCicpChunk(const png_unknown_chunk& chunk) {
        ...
        }

        } // namespace
        ```

      • Patch Set #8, Line 213: inline std::unique_ptr<ColorProfile> ReadColorProfile(png_structp png,

        I believe ReadColorProfile() is also used in file scope only, even though it's not declared as static.

      • Patch Set #8, Line 393: static inline void SetRGBAPremultiplyRowNeon(png_bytep src_ptr,

        Note these file-scope static functions.

    To view, visit change 3705739. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ia7717f161bd1569691e07c9216957814f2c073f0
    Gerrit-Change-Number: 3705739
    Gerrit-PatchSet: 8
    Gerrit-Owner: Luca Versari <vel...@google.com>
    Gerrit-Reviewer: Peter Kasting <pkas...@chromium.org>
    Gerrit-Reviewer: Wan-Teh Chang <w...@google.com>
    Gerrit-CC: Chris Blume <cbl...@chromium.org>
    Gerrit-CC: Dale Curtis <dalec...@chromium.org>
    Gerrit-CC: Eugene Kliuchnikov <eus...@chromium.org>
    Gerrit-CC: Moritz Firsching <firs...@google.com>
    Gerrit-CC: Sami Boukortt <sbou...@google.com>
    Gerrit-Attention: Luca Versari <vel...@google.com>
    Gerrit-Attention: Eugene Kliuchnikov <eus...@chromium.org>
    Gerrit-Comment-Date: Thu, 23 Jun 2022 18:59:51 +0000

    Luca Versari (Gerrit)

    unread,
    Jun 23, 2022, 5:16:05 PM6/23/22
    to blink-...@chromium.org, cblume+im...@chromium.org, kinuko...@chromium.org, mbarowsky+watc...@chromium.org, Wan-Teh Chang, Moritz Firsching, Chris Blume, Eugene Kliuchnikov, Sami Boukortt, Peter Kasting, Dale Curtis, chromium...@chromium.org

    Attention is currently required from: Eugene Kliuchnikov.

    View Change

    3 comments:

    • File third_party/blink/renderer/platform/image-decoders/png/png_image_decoder.cc:

      • Existing code uses `static` to mark file-scope functions. […]

        Done

      • Nit: I suggest adding a blank line after line 54 and before this line, like so: […]

        Ack

      • I believe ReadColorProfile() is also used in file scope only, even though it's not declared as stati […]

        I marked this one as static too.

    To view, visit change 3705739. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ia7717f161bd1569691e07c9216957814f2c073f0
    Gerrit-Change-Number: 3705739
    Gerrit-PatchSet: 8
    Gerrit-Owner: Luca Versari <vel...@google.com>
    Gerrit-Reviewer: Peter Kasting <pkas...@chromium.org>
    Gerrit-Reviewer: Wan-Teh Chang <w...@google.com>
    Gerrit-CC: Chris Blume <cbl...@chromium.org>
    Gerrit-CC: Dale Curtis <dalec...@chromium.org>
    Gerrit-CC: Eugene Kliuchnikov <eus...@chromium.org>
    Gerrit-CC: Moritz Firsching <firs...@google.com>
    Gerrit-CC: Sami Boukortt <sbou...@google.com>
    Gerrit-Attention: Eugene Kliuchnikov <eus...@chromium.org>
    Gerrit-Comment-Date: Thu, 23 Jun 2022 21:15:55 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No

    Wan-Teh Chang (Gerrit)

    unread,
    Jun 23, 2022, 5:25:09 PM6/23/22
    to Luca Versari, blink-...@chromium.org, cblume+im...@chromium.org, kinuko...@chromium.org, mbarowsky+watc...@chromium.org, Wan-Teh Chang, Moritz Firsching, Chris Blume, Eugene Kliuchnikov, Sami Boukortt, Peter Kasting, Dale Curtis, chromium...@chromium.org

    Attention is currently required from: Eugene Kliuchnikov, Luca Versari.

    Patch set 9:Code-Review +1

    View Change

    1 comment:

    To view, visit change 3705739. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ia7717f161bd1569691e07c9216957814f2c073f0
    Gerrit-Change-Number: 3705739
    Gerrit-PatchSet: 9
    Gerrit-Owner: Luca Versari <vel...@google.com>
    Gerrit-Reviewer: Peter Kasting <pkas...@chromium.org>
    Gerrit-Reviewer: Wan-Teh Chang <w...@google.com>
    Gerrit-CC: Chris Blume <cbl...@chromium.org>
    Gerrit-CC: Dale Curtis <dalec...@chromium.org>
    Gerrit-CC: Eugene Kliuchnikov <eus...@chromium.org>
    Gerrit-CC: Moritz Firsching <firs...@google.com>
    Gerrit-CC: Sami Boukortt <sbou...@google.com>
    Gerrit-Attention: Luca Versari <vel...@google.com>
    Gerrit-Attention: Eugene Kliuchnikov <eus...@chromium.org>
    Gerrit-Comment-Date: Thu, 23 Jun 2022 21:24:59 +0000

    Chris Blume (Gerrit)

    unread,
    Jun 23, 2022, 8:44:21 PM6/23/22
    to Luca Versari, blink-...@chromium.org, cblume+im...@chromium.org, kinuko...@chromium.org, mbarowsky+watc...@chromium.org, Wan-Teh Chang, Moritz Firsching, Eugene Kliuchnikov, Sami Boukortt, Peter Kasting, Dale Curtis, chromium...@chromium.org

    Attention is currently required from: Eugene Kliuchnikov, Luca Versari.

    Patch set 9:Code-Review +1

    View Change

    1 comment:

    • Patchset:

    To view, visit change 3705739. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: Ia7717f161bd1569691e07c9216957814f2c073f0
    Gerrit-Change-Number: 3705739
    Gerrit-PatchSet: 9
    Gerrit-Owner: Luca Versari <vel...@google.com>
    Gerrit-Reviewer: Chris Blume <cbl...@chromium.org>
    Gerrit-Reviewer: Peter Kasting <pkas...@chromium.org>
    Gerrit-Reviewer: Wan-Teh Chang <w...@google.com>
    Gerrit-CC: Dale Curtis <dalec...@chromium.org>
    Gerrit-CC: Eugene Kliuchnikov <eus...@chromium.org>
    Gerrit-CC: Moritz Firsching <firs...@google.com>
    Gerrit-CC: Sami Boukortt <sbou...@google.com>
    Gerrit-Attention: Luca Versari <vel...@google.com>
    Gerrit-Attention: Eugene Kliuchnikov <eus...@chromium.org>
    Gerrit-Comment-Date: Fri, 24 Jun 2022 00:44:13 +0000

    Luca Versari (Gerrit)

    unread,
    Jun 24, 2022, 1:12:15 AM6/24/22
    to blink-...@chromium.org, cblume+im...@chromium.org, kinuko...@chromium.org, mbarowsky+watc...@chromium.org, Chris Blume, Wan-Teh Chang, Moritz Firsching, Eugene Kliuchnikov, Sami Boukortt, Peter Kasting, Dale Curtis, chromium...@chromium.org

    Attention is currently required from: Eugene Kliuchnikov, Luca Versari.

    Patch set 9:Commit-Queue +2

    View Change

      To view, visit change 3705739. To unsubscribe, or for help writing mail filters, visit settings.

      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: Ia7717f161bd1569691e07c9216957814f2c073f0
      Gerrit-Change-Number: 3705739
      Gerrit-PatchSet: 9
      Gerrit-Owner: Luca Versari <vel...@google.com>
      Gerrit-Reviewer: Chris Blume <cbl...@chromium.org>
      Gerrit-Reviewer: Luca Versari <vel...@google.com>
      Gerrit-Reviewer: Peter Kasting <pkas...@chromium.org>
      Gerrit-Reviewer: Wan-Teh Chang <w...@google.com>
      Gerrit-CC: Dale Curtis <dalec...@chromium.org>
      Gerrit-CC: Eugene Kliuchnikov <eus...@chromium.org>
      Gerrit-CC: Moritz Firsching <firs...@google.com>
      Gerrit-CC: Sami Boukortt <sbou...@google.com>
      Gerrit-Attention: Luca Versari <vel...@google.com>
      Gerrit-Attention: Eugene Kliuchnikov <eus...@chromium.org>
      Gerrit-Comment-Date: Fri, 24 Jun 2022 05:12:07 +0000
      Gerrit-HasComments: No
      Gerrit-Has-Labels: Yes
      Gerrit-MessageType: comment

      Luca Versari (Gerrit)

      unread,
      Jun 24, 2022, 7:11:37 AM6/24/22
      to blink-...@chromium.org, cblume+im...@chromium.org, kinuko...@chromium.org, mbarowsky+watc...@chromium.org, Chromium LUCI CQ, Chris Blume, Wan-Teh Chang, Moritz Firsching, Eugene Kliuchnikov, Sami Boukortt, Peter Kasting, Dale Curtis, chromium...@chromium.org

      Attention is currently required from: Eugene Kliuchnikov, Luca Versari.

      Patch set 9:Commit-Queue +2

      View Change

        To view, visit change 3705739. To unsubscribe, or for help writing mail filters, visit settings.

        Gerrit-Project: chromium/src
        Gerrit-Branch: main
        Gerrit-Change-Id: Ia7717f161bd1569691e07c9216957814f2c073f0
        Gerrit-Change-Number: 3705739
        Gerrit-PatchSet: 9
        Gerrit-Owner: Luca Versari <vel...@google.com>
        Gerrit-Reviewer: Chris Blume <cbl...@chromium.org>
        Gerrit-Reviewer: Luca Versari <vel...@google.com>
        Gerrit-Reviewer: Peter Kasting <pkas...@chromium.org>
        Gerrit-Reviewer: Wan-Teh Chang <w...@google.com>
        Gerrit-CC: Dale Curtis <dalec...@chromium.org>
        Gerrit-CC: Eugene Kliuchnikov <eus...@chromium.org>
        Gerrit-CC: Moritz Firsching <firs...@google.com>
        Gerrit-CC: Sami Boukortt <sbou...@google.com>
        Gerrit-Attention: Luca Versari <vel...@google.com>
        Gerrit-Attention: Eugene Kliuchnikov <eus...@chromium.org>
        Gerrit-Comment-Date: Fri, 24 Jun 2022 11:11:29 +0000

        Chromium LUCI CQ (Gerrit)

        unread,
        Jun 24, 2022, 8:04:32 AM6/24/22
        to Luca Versari, blink-...@chromium.org, cblume+im...@chromium.org, kinuko...@chromium.org, mbarowsky+watc...@chromium.org, Chris Blume, Wan-Teh Chang, Moritz Firsching, Eugene Kliuchnikov, Sami Boukortt, Peter Kasting, Dale Curtis, chromium...@chromium.org

        Chromium LUCI CQ submitted this change.

        View Change


        Approvals: Chris Blume: Looks good to me Peter Kasting: Looks good to me Luca Versari: Commit Wan-Teh Chang: Looks good to me
        Implement cICP chunk for PNG as per version 3 of the spec.

        See also https://github.com/w3c/PNG-spec/issues/129 for an editorial
        issue in the PNG specification wrt the size of the fields of the cICP
        chunk.

        PAIR=sbou...@google.com

        Change-Id: Ia7717f161bd1569691e07c9216957814f2c073f0
        Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3705739
        Reviewed-by: Wan-Teh Chang <w...@google.com>
        Reviewed-by: Chris Blume <cbl...@chromium.org>
        Commit-Queue: Luca Versari <vel...@google.com>
        Reviewed-by: Peter Kasting <pkas...@chromium.org>
        Cr-Commit-Position: refs/heads/main@{#1017577}
        ---
        M third_party/blink/renderer/platform/image-decoders/png/png_image_decoder.cc
        M third_party/blink/renderer/platform/image-decoders/png/png_image_decoder_test.cc
        M third_party/blink/renderer/platform/image-decoders/png/png_image_reader.cc
        A third_party/blink/web_tests/images/resources/cicp_pq.png
        4 files changed, 119 insertions(+), 8 deletions(-)


        To view, visit change 3705739. To unsubscribe, or for help writing mail filters, visit settings.

        Gerrit-Project: chromium/src
        Gerrit-Branch: main
        Gerrit-Change-Id: Ia7717f161bd1569691e07c9216957814f2c073f0
        Gerrit-Change-Number: 3705739
        Gerrit-PatchSet: 10
        Gerrit-Owner: Luca Versari <vel...@google.com>
        Gerrit-Reviewer: Chris Blume <cbl...@chromium.org>
        Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
        Gerrit-Reviewer: Luca Versari <vel...@google.com>
        Gerrit-Reviewer: Peter Kasting <pkas...@chromium.org>
        Gerrit-Reviewer: Wan-Teh Chang <w...@google.com>
        Gerrit-CC: Dale Curtis <dalec...@chromium.org>
        Gerrit-CC: Eugene Kliuchnikov <eus...@chromium.org>
        Gerrit-CC: Moritz Firsching <firs...@google.com>
        Gerrit-CC: Sami Boukortt <sbou...@google.com>
        Gerrit-MessageType: merged
        Reply all
        Reply to author
        Forward
        0 new messages