Opened 13 years ago
Closed 13 years ago
Last modified 13 years ago
#3416 closed defect (fixed)
Win7 MSPaint Produces Screwy, Hard to Read PNG Files
|Reported by:||warmerdam||Owned by:||warmerdam|
Graeme Hiebert and Dale Lutz have reported that Win7 MSPaint will sometimes produce hard to read PNG files like the attached one.
Change History (3)
by , 13 years ago
comment:1 by , 13 years ago
|Status:||new → closed|
There is a "zero chunk" in this file starting at byte 0x46 with a zero length, and a chunk name of 0x00000000 but a proper crc checksum for this name.
00000030: 0500 0000 0970 4859 7300 000e c400 000e .....pHYs....... 00000040: c401 952b 0e1b 0000 0000 0000 0000 2144 ...+..........!D 00000050: df1c 0000 ffa6 4944 4154 785e ecfd 0780 ......IDATx^....
The libpng code checks for chunk names with special characters and issues a fatal error. It also issues a fatal error if the chunk is unknown and has a zero high order bit on character one which apparently indicates it is a "critical chunk".
In order to read this file with GDAL I relaxed both items to be warnings and then it works fine. I have incorporated this change into trunk (r18808) though I'm personally a bit dubious about whether it is better to read this message or to just fail. It is fairly likely this "fix" will be lost in the next update from libpng.
Difficult to read png file.