def bmp_info(data): s=struct.unpack('<ccIIIIIIHH',data[:30]) if (s[0]+s[1]) in [b'BM',b'BA']: return { 'width': s[6], 'height': s[7], 'color': s[9] } else: return False
Sign in to make a reply
zL丶_44830
def bmp_info(data): s=struct.unpack('<ccIIIIIIHH',data[:30]) if (s[0]+s[1]) in [b'BM',b'BA']: return { 'width': s[6], 'height': s[7], 'color': s[9] } else: return False