def bmp_info(data): ups = struct.unpack('<ccIIIIIIHH', data[0:30]) if ups[0]+ups[1] != b'BM' and ups[0]+ups[1] != b'BA': print('不是位图') return return { 'width': ups[-4], 'height': ups[-3], 'color': ups[-1] }
Sign in to make a reply
苏生不语_