def bmp_info(data):
a=struct.unpack('<ccIIIIIIHH',data[0:30])
if a[0:2]==(b'B',b'M') or (b'B',b'A'):
print('true')
return {
'width': a[-4],
'height': a[-3],
'color': a[-1]
}
Sign in to make a reply
冷酷的皮皮丶
def bmp_info(data):
a=struct.unpack('<ccIIIIIIHH',data[0:30])
if a[0:2]==(b'B',b'M') or (b'B',b'A'):
print('true')
return {
'width': a[-4],
'height': a[-3],
'color': a[-1]
}