def bmp_info(data): s = struct.unpack('<ccIIIIIIHH', data[:30]) if s[1] == b'M': return { 'width': s[-4], 'height': s[-3], 'color': s[-1] } else: print('不是bmp文件')
Sign in to make a reply
冲浪小白兔
def bmp_info(data): s = struct.unpack('<ccIIIIIIHH', data[:30]) if s[1] == b'M': return { 'width': s[-4], 'height': s[-3], 'color': s[-1] } else: print('不是bmp文件')