Discuss / Python / 作业

作业

Topic source

Roger_R36

#1 Created at ... [Delete] [Delete and Lock User]
def bmp_info(data):
    bmpbytes = data[:30]

    dd = struct.unpack('<ccIIIIIIHH', bmpbytes)
    
    if dd[1] == b'M': 
        return {
            'width': dd[6],
            'height': dd[7],
            'color': dd[9]
        }
    else:
        return

  • 1

Reply