Discuss / Python / solution

solution

Topic source

洪哥传奇

#1 Created at ... [Delete] [Delete and Lock User]

def bmp_info(data):

    fbyte,sbyte,*_,width, height, _, color=struct.unpack('<ccIIIIIIHH', data[:30])

    if fbyte+sbyte != b'BM':

       print('Not bmp.')

    else:

       return {

            'width': width,

            'height': height,

            'color': color

       }


  • 1

Reply