Photoshop CS6 cannot read some uncompressed PNG files (truncated files)

  • 4
  • Problem
  • Updated 5 years ago
  • Solved
  • (Edited)
Photoshop CS6 still cannot load uncompressed 24bit PNG files created with libpng.

Example files can be provided if anyone at Adobe's interested. YeahEverything else on every other platform I've tried can read the PNG just fine, but not Photoshop, which throws the error "Could not complete your request because the file-format module cannot parse the file".

This is really kinda annoying.
Photo of Ian Jeffray

Ian Jeffray

  • 5 Posts
  • 1 Reply Like
  • frustrated

Posted 6 years ago

  • 4
Photo of Chris Cox

Chris Cox

  • 20280 Posts
  • 823 Reply Likes
That's odd, Photoshop opens every PNG in the libPNG test files, and every example we've found (that wasn't obviously corrupt).

Yes, please let me know where to find these files so I can take a look and see what's going on.
Photo of Ian Jeffray

Ian Jeffray

  • 5 Posts
  • 1 Reply Like
Hi Chris. Thanks for responding.
Here's an example which fails in CS4 and CS6 at least... not encountered any other program on OSX or Win7 that won't open this.

http://ian.jeffray.co.uk/uncompressed...
Photo of Chris Cox

Chris Cox

  • 20280 Posts
  • 764 Reply Likes
OK, yeah, that's a problem. Not sure why nobody has reported it before or we haven't seen it before.

It'll take a while to figure out why the PNG parser isn't happy with that file.
Photo of Chris Veliquette

Chris Veliquette

  • 1 Post
  • 0 Reply Likes
I am having the same problem with my set of PNG files delivered from a truck body manufacturer. I can view it in any other viewer, just not photoshop cs6
Photo of Chris Cox

Chris Cox

  • 20280 Posts
  • 764 Reply Likes
Email me a copy and I'll see if I can figure out why.
ccox (at) adobe [dot] com
Photo of Chris Cox

Chris Cox

  • 20280 Posts
  • 764 Reply Likes
This latest problem turned out to be because they were JPEG files saved with the wrong file extension. Thus the PNG plugin really couldn't parse the files...
Photo of Glenn Randers-Pehrson

Glenn Randers-Pehrson

  • 2 Posts
  • 2 Reply Likes
The IEND chunk is missing. Progressive-readers such as Firefox don't notice because they display the image on-the-fly.
Photo of Glenn Randers-Pehrson

Glenn Randers-Pehrson

  • 2 Posts
  • 2 Reply Likes
Also the last IDAT chunk is truncated. I suppose more IDAT chunks are missing as well.
Photo of Ian Jeffray

Ian Jeffray

  • 5 Posts
  • 1 Reply Like
Thank you so much for the reply Glenn. This is surprising. It's only Photoshop that I've ever seen be upset, so I've always assumed that it's Photoshop that's at fault and I've been advising clients to use other image editors for PNG. Perhaps Photoshop could be a little more "relaxed" in its parsing, though?

I guess it's possible this is some issue in the way I'm calling libpng. The way my applications use libpng are really very simple indeed, just feeding 3 channel 8bit RGB data. I'll attempt to dig in to this more deeply myself, but basically, I see that compressed images are fine in Photoshop, it's uncompressed ones that fail. I only use uncompressed output because it's so much quicker than even Z_BEST_SPEED.
Photo of Chris Cox

Chris Cox

  • 20280 Posts
  • 813 Reply Likes
Not only is the IEND chunk missing, part of the data is missing as well. It hits an error on row 904 of 916 because the file is truncated.

Yes, there is a bug in the code that wrote your files -- that needs to be fixed.

I'm not sure how easily we could detect a corrupt file versus a partly complete file and recover. I'll have to see what I can do about putting up a "this file is incomplete, but we're showing you what we managed to decode" message.
Photo of devang solanki

devang solanki

  • 1 Post
  • 0 Reply Likes
same issue like Ian Jeffray faces
Photo of Chris Cox

Chris Cox

  • 20280 Posts
  • 813 Reply Likes
Then you need to resave your files from whatever application wrote the PNG files - because it wrote them incorrectly (truncated, missing data from the end).
Photo of Alex Santos

Alex Santos

  • 1 Post
  • 0 Reply Likes
hi, my phtoshop cs6 dont open any .png, i have a message saying: Could not complete your request because the file was not found!

what can i do?
Photo of Chris Cox

Chris Cox

  • 20280 Posts
  • 813 Reply Likes
First, post a new topic because that problem is not related to this topic.
Photo of Brandi Reed

Brandi Reed

  • 2 Posts
  • 0 Reply Likes
Hello I am having the could not complete your request because the file-format module cannot parse the file error. On this photo it is from imvu. I have some pics from there that open fine others don't.
Photo of Chris Cox

Chris Cox

  • 20280 Posts
  • 764 Reply Likes
That usually means that the file is corrupt or truncated.

And your example doesn't do much good because it is displayed as a JPEG.
Photo of Brandi Reed

Brandi Reed

  • 2 Posts
  • 0 Reply Likes
Okay thanks I will try to figure it out.
Photo of Lionel Farseer

Lionel Farseer

  • 1 Post
  • 0 Reply Likes
Coming way late here but, being also an IMVU user, had the same problem Brandi Reed talked about.

Chris Cox's suggestion above that "they were JPEG files saved with the wrong file extension" is quite probably the case with us both. As an experiment, I changed the extension of the PNG file (which was generated by the IMVU chat client) to JPG, and PS6 opened it without a glitch.

So, in the case of us IMVU users, it seems that the program is saving the screenshots with the WRONG file extension.
Photo of JW

JW

  • 2 Posts
  • 0 Reply Likes
Hi all,

I have the problem described above, where Photoshop CS6 won't open some .png files (an example is here https://dl.dropboxusercontent.com/u/8...). I get the error message, "Could not complete your request because the file-format module cannot parse the file."

I have tried changing the extension to .jpg but this doesn't work.

Any ideas?

Thanks
Photo of Ian Jeffray

Ian Jeffray

  • 5 Posts
  • 1 Reply Like
There's something wrong with your PNG file. Yes, lots of apps will read it, but Photoshop and ImageMagick don't. Adobe appear uninterested in doing a "load it as best we can" kind of option, and instead just throw the dummy. Poor attitude for such a company with such a product in my opinion.

Here's what ImageMagick has to say anyway:
$ convert Horse\ 2\ Positive.png foo.ppm
convert.im6: Expected 8192 bytes; found 2492 bytes `Horse 2 Positive.png' @ warning/png.c/MagickPNGWarningHandler/1754.
convert.im6: Read Exception `Horse 2 Positive.png' @ error/png.c/MagickPNGErrorHandler/1728.
convert.im6: corrupt image `Horse 2 Positive.png' @ error/png.c/ReadPNGImage/3723.
Photo of JW

JW

  • 2 Posts
  • 0 Reply Likes
Ok thanks. Sadly it's a PNG made by somebody who has now left the company, so it's the only copy of the file that we have - shame Photoshop can't open it!
Photo of xeni Craft

xeni Craft

  • 1 Post
  • 0 Reply Likes
Hello, I found a solution that works for me on a Mac but might not work for you.
On a Mac, what I did was open the file in Preview, then simply Exported it as a jpg, and photoshop opened it fine! I have not tried resaving as png, maybe you could give it a shot...

Hope this helps!
xeni
Photo of Bjoern Johan Skvargerson

Bjoern Johan Skvargerson

  • 1 Post
  • 0 Reply Likes
This may be a little late but for everyone else... if you're using Firefox, you can install the free addon "Pictutools" and simply right-click the image and choose convert it to PNG. You can check it out here:
https://addons.mozilla.org/en-US/fire...