Discuss / Python / 记录

记录

Topic source

def bmp_info(data):

    bina_list = struct.unpack('<ccIIIIIIHH', data[:30])

    #if bina_list[0] == b'B' and bina_list[1] == b'M' :

    if bina_list[:2] == (b'B', b'M'):

        return {

            'width': bina_list[6],

            'height': bina_list[7],

            'color': bina_list[9]

        }


  • 1

Reply