Discuss / Python / 练习

练习

Topic source
def bmp_info(data):
    tu = struct.unpack('<ccIIIIIIHH', data[:30])
    if tu[0] == b'B' and tu[1] == b'M':
        return {
            'width': tu[6],
            'height': tu[7],
            'color': tu[9]
        }
    return None

  • 1

Reply