pics
pics copied to clipboard
Incorrect CRC32 Checksum in `PNG.png`
For the following graphic in /binary/PNG.png
the CRC32 Checksum is incorrect for the IEND
chunk.
The CRC32 checksum is only calculated on the header type for the IEND chunk due to the chunk length of 0. The following output is the calculated CRC32 checksum (so the graphic just has a small typo of one incorrect hex character).
import zlib
checksum = zlib.crc32(b"IEND")
print("Checksum:", hex(checksum))
> Checksum: 0xae426082
The graphic on the left hand side has the correct checksum.
Additionally, I am also curious if there could be a way to indicate in the graphic that the CRC32 checksum does NOT include the chunk length as shown in this blog post. The current graphic makes it appear that the length is included when calculating the checksum when in reality only the chunk contents and the chunk type are.