Closed DutChen18 closed 2 years ago
I'm also seeing this regression with a bunch of other images.
(For example https://raw.githubusercontent.com/slint-ui/slint/v0.1.6/examples/imagefilter/cat_preview_round.png )
I still encountered this error with version 0.24.8 with this image:
The Error shown was: Decoding(DecodingError { format: Exact(Png), underlying: Some(Format(FormatError { inner: DuplicateChunk { kind: ChunkType { type: iCCP, critical: false, private: false, reserved: false, safecopy: false } } })) })
.
Running with version 0.23.14 currently solves the issue.
@ScranchNew Make sure you run cargo update
. If you're still seeing this failure, please open a new issue with both the code you're using and the exact png
crate version (0.23.14 and 0.24.8 are versions of the image
crate which are compatible multiple png
crate versions).
If one can still reproduce this issue with the last png version, the best would be to open the issue directly on the png crate repository and attach the exact image. https://github.com/image-rs/image-png
This image with an sRGB chunk preceding a gAMA chunk fails to decode in 0.17.4 but it decodes fine in 0.17.3. https://user-images.githubusercontent.com/6209323/155889742-979e8698-2e87-4206-8930-a1a454c2dc10.png
I believe the breaking change to be from #334
The error originates from this check: https://github.com/image-rs/image-png/blob/bb55a6646b2493b1411dacb870faa5ef49003a3c/src/decoder/stream.rs#L959-L963 Because
source_gamma
is set inparse_srgb
here: https://github.com/image-rs/image-png/blob/bb55a6646b2493b1411dacb870faa5ef49003a3c/src/decoder/stream.rs#L991-L995