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

Support gAMA, cHRM chunks #4

Open
wezm opened this issue Feb 14, 2021 · 4 comments
Open

Support gAMA, cHRM chunks #4

wezm opened this issue Feb 14, 2021 · 4 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@wezm
Copy link
Contributor

wezm commented Feb 14, 2021

Is your feature request related to a problem? Please describe.

Attempting to read an image with a gAMA and cHRM chunks (which are in the PNG1.2 spec) results in UnknownChunkType error.

Describe the solution you'd like

I'd like to be able to losslessly stream a PNG from a Decoder to Encoder, to do so it would be ideal to propagate all chunks from the source to the destination. Perhaps there could be an extra variant Unknown added to Chunk that carries the chunk type and data, so that it can be passed through to the encoder as-is.

Describe alternatives you've considered

I can ignore the error for now and skip this chunk.

Additional context

The image in question:

Screenshot_2021-02-12 Screenshot-192

@AldaronLau
Copy link
Owner

@wezm Thanks for opening an issue! I think that sounds like a good solution (adding an Unknown variant to Chunk). Eventually I would like to support the chunks directly as well, so I guess there's two task items here. I might be able to work on it next weekend, otherwise if you want to make a PR, feel free to.

@AldaronLau AldaronLau added enhancement New feature or request good first issue Good for newcomers labels Feb 14, 2021
@AldaronLau
Copy link
Owner

I'm going to leave this issue open until gAMA and cHRM chunks can be parsed and written, even though unknown chunks have now been implemented on master.

@AldaronLau
Copy link
Owner

@wezm Just released png_pong 0.8.0, with your PRs for UnknownChunk and std::error::Error.

@wezm
Copy link
Contributor Author

wezm commented Feb 15, 2021

Wonderful. Thank you 😀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants