def bmp_info(data):
fbyte,sbyte,*_,width, height, _, color=struct.unpack('<ccIIIIIIHH', data[:30])
if fbyte+sbyte != b'BM':
print('Not bmp.')
else:
return {
'width': width,
'height': height,
'color': color
}
Sign in to make a reply
洪哥传奇
def bmp_info(data):
fbyte,sbyte,*_,width, height, _, color=struct.unpack('<ccIIIIIIHH', data[:30])
if fbyte+sbyte != b'BM':
print('Not bmp.')
else:
return {
'width': width,
'height': height,
'color': color
}