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

Format error decoding Png: Invalid PNG signature. When reading png with embedded color profile #2260

Closed
francisdb opened this issue Jun 13, 2024 · 4 comments

Comments

@francisdb
Copy link

francisdb commented Jun 13, 2024

Gimp

image

macOS file info

image

Expected

Reads file

Actual behaviour

Format error decoding Png: Invalid PNG signature.

Reproduction steps

let decoder = image::io::Reader::open(file_path)?.with_guessed_format()?;
let dimensions_from_file = match decoder.into_dimensions() {...}

g5kscratchedmorelight.png.zip

Looks like there's more applications that have problems opening this file. Eg Firefox.

@ripytide
Copy link
Member

I can't open that image with sxiv:

sxiv: g5kscratchedmorelight.png: Error opening image
sxiv: no more files to display, aborting

The output of pngcheck is:

g5kscratchedmorelight.png  this is neither a PNG or JNG image nor a MNG stream
ERROR: g5kscratchedmorelight.png

And https://www.nayuki.io/page/png-file-chunk-inspector also shows some errors.

I'm fairly confident that that is a invalid png image and so there is no issue with this library and this issue should be closed.

@francisdb
Copy link
Author

francisdb commented Jun 24, 2024

Thanks for checking. Closing and might report back if I see this again for other images.

@nayuki
Copy link

nayuki commented Jun 24, 2024

g5kscratchedmorelight.png.zip

Regarding that ".png" file, it starts with the characters "8BPS". It is a Photoshop (PSD) file. https://stackoverflow.com/questions/20518335/why-do-photoshop-files-start-with-8bps

@francisdb
Copy link
Author

francisdb commented Jun 24, 2024

Thanks @nayuki
I should have just run file 😳

> file g5kscratchedmorelight.png 
g5kscratchedmorelight.png: Adobe Photoshop Image, 512 x 512, RGBA, 4x 8-bit channels

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

No branches or pull requests

3 participants