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.
#Pimoroni's #jpegdec included in #PicoGraphics was returning 0,0 until decoding and displaying the JPG, so if anyone needs to do get the height and width in #MicroPython so you can do things before displaying the image, here's a gist with the basics:
https://gist.github.com/yezzer/737f61eff7d6ff9f5ce471b3298aeacb#file-get_jpg_size-py
#pimoroni #jpegdec #picographics #micropython