Discuss / Python / 交作业,还是比较好做的

交作业,还是比较好做的

Topic source

gd83594394

#1 Created at ... [Delete] [Delete and Lock User]
def bmp_info(data):
    if struct.unpack('<ccIIIIIIHH', bmp_data[0:30])[0] == b'B' and struct.unpack('<ccIIIIIIHH', bmp_data[0:30])[1] == b'M':
        return {
        'width': struct.unpack('<ccIIIIIIHH', bmp_data[0:30])[6],
        'height': struct.unpack('<ccIIIIIIHH', bmp_data[0:30])[7],
        'color': struct.unpack('<ccIIIIIIHH', bmp_data[0:30])[9]
    }

  • 1

Reply