import struct with open('C:/users/xyeg/desktop/z.txt', 'rb') as f: s = f.read()[:30] l = struct.unpack('<ccIIIIIIHH', s) if struct.unpack('<cc', s[:2]) == (b'B', b'M'): print(l[2]) print(l[9]) else: print('Not a Windows BMP!')
Sign in to make a reply
LesLieM樂