PNGs: Half decoded

Bugs found in XnView Classic. Please report only one bug per topic!

Moderators: XnTriq, helmut, xnview

Post Reply
CheloXL
Posts: 6
Joined: Wed Jun 03, 2009 6:37 pm

PNGs: Half decoded

Post 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,
eL_PuSHeR
Posts: 267
Joined: Sat Apr 25, 2009 9:23 am

Re: PNGs: Half decoded

Post 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.
Intel i7 5960X
Gigabye GA-X99-Gaming 5
8 GB DDR4 (2100)
GeForce GTX 970 (Gigabyte)
CheloXL
Posts: 6
Joined: Wed Jun 03, 2009 6:37 pm

Re: PNGs: Half decoded

Post 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).
User avatar
Drahken
Posts: 884
Joined: Sun Apr 10, 2005 4:29 pm

Re: PNGs: Half decoded

Post 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.
Oh the feuhrer, oh the feuhrer, oh the feuhrer's nipples bonk!
CheloXL
Posts: 6
Joined: Wed Jun 03, 2009 6:37 pm

Re: PNGs: Half decoded

Post 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...
Post Reply