def bmp_info(data):
header=bmp_data[:30]
all_info=struct.unpack('<ccIIIIIIHH',header)
if all_info[0]==b'B' and all_info==b'M':
return {
'width': all_info[6],
'height': all_info[7],
'color': all_info[9]
}
return False
Sign in to make a reply
这样的话17422
def bmp_info(data):
header=bmp_data[:30]
all_info=struct.unpack('<ccIIIIIIHH',header)
if all_info[0]==b'B' and all_info==b'M':
return {
'width': all_info[6],
'height': all_info[7],
'color': all_info[9]
}
return False