Page 1 of 1

PNGs: Half decoded

Posted: Wed Aug 22, 2012 6:33 pm
by CheloXL
Hi,
It seems that there are some PNGs that are stored in several chunks (or that's what I believe), because XnView only displays half of them (and by half I mean half of the image). Depending on the image size (width, height), XnView can display the complete image, the top vertical half, the top vertical third, etc.

Examples:
http://www.extremefx.com.ar/temp/x2.png
http://www.extremefx.com.ar/temp/x4.png

Both are exactly the same image, one is twice the size of the other. On the first one (x2) you can see only half of it. On the second one, you can see only 1/4 of it.

Thanks in advance and regards,

Re: PNGs: Half decoded

Posted: Thu Aug 23, 2012 7:10 am
by eL_PuSHeR
Firefox 14.0.1 cannot display them either. Are you sure they are valid?

Are they coming from a mobile device? They don't seem official PNGs.

Irfanview cannot open them. PSP X3 can't either.

PNGOut complains about not being standard/unsupported.

Re: PNGs: Half decoded

Posted: Thu Aug 23, 2012 11:36 am
by CheloXL
They are valid and yes, they come from a mobile device (iPad). Usually on PNGs, the image is stored in one data chunk (IDAT). But it is possible (and valid, based on the PNG specifications) that the image be stored in several data chunks, to generate a PNG in a streaming manner. This is done in that way on mobiles to optimize the upload of the image to the GPU (because you have to upload the image in chunks, and in that way you already have the chunks ready and do not have to do the splitting on the run).

Re: PNGs: Half decoded

Posted: Thu Aug 23, 2012 8:49 pm
by Drahken
There is a history of apple using atypical PNG features, especially in their mobile devices. There's another thread or two floating around here about PNGs created by iphones which non-apple software can't handle properly. I do believe that apple is doing this kind of stuff intentionally, to try to force people to use apple products & software.

Re: PNGs: Half decoded

Posted: Thu Aug 23, 2012 9:11 pm
by CheloXL
Yes, I know. Apple's PNG have a non-standard chunk type (CgBI - that XNView ignores, so that's ok), and some PNGs have byteswapped (RGBA -> BGRA) pixel data (and that's something I can fix in any photo editor), premultiplied alpha, etc. But the image stored in several IDAT chunks is totally valid on PNG files. That no one ever used, that's correct...