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
iphone screen shot(png) fails to decode #1825
Comments
Looks like it's embedding two iCCP (color management) chunks, which is invalid. Most likely, the editing software takes one of them out of the image before resaving. Do you have an example file to verify? |
I'm also running into this problem in my project. Can reproduce in a blank project with fn main() {
image::open("wafles-mine.png").unwrap();
} Versions:
|
This is supposed to be valid?
Suppose we interpret should too strongly and should rather ignore the duplicate? After all, the chunk is technically not critical but that seems like a potential hazard to me if we only report one. An iCCP chunk contains zlib/deflate compressed data. The two chunks are both identified as |
I think so
I'm not sure what data you mean here. The zlib/deflate compressed data of the iCCP chunk? What does it have to do with the window size? (disclaimer: I haven't delved into image formats before) |
That issue has only started happening with 0.17.4, which makes sense, because image-rs/image-png#334 was merged by then |
FWIW, it seems that the reference implementation ignores subsequent iCCP chunks https://github.com/glennrp/libpng/blob/f8e5fa92b0e37ab597616f554bee254157998227/pngrutil.c#L1396-L1407 and treats them as a benign error https://github.com/glennrp/libpng/blob/f8e5fa92b0e37ab597616f554bee254157998227/pngrutil.c#L1623-L1633. IIUC this is unlike the PR at image-rs/image-png#361 which replaces the iCCP info with the latest encountered iCCP chunk. |
This happens in , only iphone screen shot.
picture with iphone camera -> work well
png, jpeg and etc.... -> work well
but iphone screen shot(png) -> not work
Expected
expected = work well with decode.
Actual behaviour
this bug will procced with only "row iphone screenshot"
if I edit(like a crop... blur... etc...) screenshot with iphone photo app -> work well.
Reproduction steps
The text was updated successfully, but these errors were encountered: