def bmp_info(data): # 解析位图文件头部信息 info = struct.unpack('<ccIIIIIIHH', data[:30]) if info[0] != b'B' or info[1] != b'M': raise ValueError('Not a BMP file') return { 'width': info[6], 'height': info[7], 'color': info[9] }
Sign in to make a reply
Super-String