def bmp_info(data):
b_info = struct.unpack('<ccIIIIIIHH', bmp_data[:30])
d = {'isBMP':False,'width':None,'height':None,'color':None}
if b_info[0] == b'B' and b_info[1] == b'M':
d['isBMP'] = True
d['width'] = b_info[6]
d['height'] = b_info[7]
d['color'] = b_info[9]
return d
Sign in to make a reply
偘
def bmp_info(data):
b_info = struct.unpack('<ccIIIIIIHH', bmp_data[:30])
d = {'isBMP':False,'width':None,'height':None,'color':None}
if b_info[0] == b'B' and b_info[1] == b'M':
d['isBMP'] = True
d['width'] = b_info[6]
d['height'] = b_info[7]
d['color'] = b_info[9]
return d