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

Add support for parsing mDCv and cLLi chunks. #528

Merged
merged 1 commit into from
Oct 31, 2024

Conversation

anforowicz
Copy link
Contributor

PTAL?

This PR is needed for parity with the existing PNG decoder in Blink / Chromium - see https://crbug.com/376550658.

IIUC Chromium and Blink only require an ability to decode these chunks - there is no need for encoding support (e.g. the search query here only finds decoder bits).

@anforowicz
Copy link
Contributor Author

The new test is based on the PNGTests.HDRMetadata test from Chromium.

@anforowicz anforowicz force-pushed the clli-and-mdcv-chunks branch 2 times, most recently from 55fa683 to c507ed0 Compare October 31, 2024 01:48
Copy link
Contributor

@fintelia fintelia left a comment

Choose a reason for hiding this comment

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

This looks good to me. Left a few minor style comments

src/decoder/stream.rs Outdated Show resolved Hide resolved
src/decoder/stream.rs Outdated Show resolved Hide resolved
This commit is needed for parity with the existing PNG decoder
in Blink / Chromium - see https://crbug.com/376550658.
@fintelia fintelia merged commit 6016c9b into image-rs:master Oct 31, 2024
19 checks passed
@anforowicz anforowicz deleted the clli-and-mdcv-chunks branch November 6, 2024 17:34
aarongable pushed a commit to chromium/chromium that referenced this pull request Nov 19, 2024
This CL patches the `png` crate in a way that corresponds to the
following upstream PRs:

* image-rs/image-png#526 - baseline to make
  subsequent patches easier to apply
* image-rs/image-png#528 - `mDCv` and `cLLI`
* image-rs/image-png#529 - `cICP`

This CL is a prerequisite for rolling Skia beyond
http://review.skia.org/917216

Bug: chromium:376758571
Bug: chromium:376550658
Change-Id: I5a70fccd71ae4295b62f7291a5fd3809f0d53860
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5999738
Commit-Queue: Łukasz Anforowicz <lukasza@chromium.org>
Reviewed-by: Adrian Taylor <adetaylor@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1385066}
hubot pushed a commit to google/skia that referenced this pull request Nov 21, 2024
This CL propagates the data from the `cICP` chunk into
`SkEncodedInfo::ICCProfile`.

Dependencies:

* This CL unblocks enabling the `PNGTests.cicp` test in the Chromium CL
  at https://crrev.com/c/6013356.
* This CL depends on the new `SkColorSpace::MakeCICP` API that was
  recently added in https://crrev.com/c/5999738.

This CL patches the `png` crate in a way that corresponds to the
following upstream PRs (rolling this CL into Chromium depends on
https://crrev.com/c/5999738 which included the same patches):

* image-rs/image-png#526 - baseline to make
  subsequent patches easier to apply
* image-rs/image-png#528 - `mDCv` and `cLLI`
* image-rs/image-png#529 - `cICP`

Bug: chromium:376758571
Change-Id: I1e550b1eba4d629ff4337d85daa5656ac03f3a5a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/917216
Commit-Queue: Łukasz Anforowicz <lukasza@google.com>
Reviewed-by: Daniel Dilan <danieldilan@google.com>
ocpkn pushed a commit to ocpkn/image-png that referenced this pull request Nov 29, 2024
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