import struct def check_bmp(filename): f = open(filename, 'rb') h = f.read(30) s = struct.unpack('<ccIIIIIIHH', h) if s[0] == b'B' and s[1] == b'M' or s[1] == b'A': print(str(s[6]) + 'x' + str(s[7]) + '@' + str(s[9]))
Sign in to make a reply
米粽粽