Discuss / Python / 交作业:

交作业:

Topic source
def bmp_info(data):
    result = struct.unpack('<ccIIIIIIHH', data[:30])
    if result[0:2] == (b'B', b'M'):
        return {'width': result[6], 'height': result[7], 'color': result[9]}
    print('This is not a bmp file!')

  • 1

Reply