robert-ancell / pygif

Python encoder and decoder for the GIF file format.
GNU Lesser General Public License v3.0
12 stars 2 forks source link

Change for micropython compatiblity #8

Closed ziggy90127 closed 1 year ago

ziggy90127 commented 1 year ago

Micropython struct pack/unpack doesn't have the "x" pad byte format character. Change 2 lines in gif.py to accept a "b" instead and ignore it.

171c171
<             (loop_count,) = struct.unpack ('<xH', subblock)
---
>             (xpad, loop_count,) = struct.unpack ('<bH', subblock)
173c173
<             (buffer_size,) = struct.unpack ('<xI', subblock)
---
>             (xpad, buffer_size,) = struct.unpack ('<bI', subblock)
robert-ancell commented 1 year ago

Thanks!

ziggy90127 commented 1 year ago

Thank you!