Chunk CheckSum Correction |
|
CheckSum Correction with PNGCSumEach chunk in a PNG image is verified for corrupted data using a CRC32 checksum, where CRC stands for Cyclic Redundancy Checksum. Check out the PNG Specification at W3C for more details on how the checksum is constructed.The four parts of a chunk are:
When you modify a PNG image by hand, like what I did to create PngSuite, the data changes and the checksum isn't valid anymore. For that purpose I created this little tool, called pngcsum, that takes such a modified PNG, recalculates the checksums and writes it out to a now valid PNG file. The tool assumes that while the data in a chunk can be changed or currupted, the length field of the chunk is still correct. The tar-ball contains the C source code and a Linux binary, which was compiled on Cent-OS 4.
|