png format pictures, the file header is 89 50 4e 47 0d 0a 1a 0a 00 00 00 0d
IHD is |
File header data block |
no |
no |
The first piece |
||
The name of the domain |
Bytes |
Explanation |
||||
Width |
4 bytes |
Image width, in pixels |
||||
Height |
4 bytes |
Image height, in pixels |
||||
Bit depth |
1 byte |
Image Depth: |
||||
ColorType |
1 byte |
Color type: |
||||
Compression method |
1 byte |
Compression method (LZ77 derived algorithm ) |
||||
Filter method |
1 byte |
Filter method |
||||
Interlace method |
1 byte |
Interlaced scanning method: |
The first four digits of the second line are wide, the next four digits are high, and 0806 is the one below. The C1 D0 B3 D4 at the back is the check code. The range of verification is from 494844 to 000000
Bit depth |
1 byte |
Image Depth: |
||||
ColorType |
1 byte |
Color type: |
py2 code for crc verification:
# -*- coding: utf-8 -*-
import binascii
import struct
crc32key = 0xC1D0B3E4
for i in range(0, 65535):
height = struct.pack('>i', i)
data = b'\x49\x48\x44\x52\x00\x00\x0C\xC0'+height+ b'\x08\x06\x00\x00\x00'
crc32result = binascii.crc32(data) & 0xffffffff
if crc32result == crc32key:
print ''.join(map(lambda c: "%02X" % ord(c), height))