yezzer · @yezzer
317 followers · 280 posts · Server fosstodon.org

TIL a JPG doesn't have any headers that define the height and width of the image?

You have to loop through the file, checking the bytes in the segments? What. That seems...inefficient.

's included in was returning 0,0 until decoding and displaying the JPG, so if anyone needs to do get the height and width in so you can do things before displaying the image, here's a gist with the basics:

gist.github.com/yezzer/737f61e

#pimoroni #jpegdec #picographics #micropython

Last updated 3 years ago