Discuss / Python / 交作业

交作业

Topic source

苏生不语_

#1 Created at ... [Delete] [Delete and Lock User]
def bmp_info(data):
    ups = struct.unpack('<ccIIIIIIHH', data[0:30])
    if ups[0]+ups[1] != b'BM' and ups[0]+ups[1] != b'BA':
        print('不是位图')
        return
    return {
        'width': ups[-4],
        'height': ups[-3],
        'color': ups[-1]
    }

  • 1

Reply