Loading (but not decompressing) jpegs

Hi,

I was wondering if there is a way to load a jpeg or mjpeg from SD card and then send that on via the wifi? The image are large as they are recorded in HD so 80-120Kb and thus need to go in the frame buffer or similar.

If you have any suggestions that would be great. Alternatively please can you add it to the todo list, I believe the jpeg decoder is already on the list and this would be a helpful first step.

In the meantime I will use uncompressed images - which will restrict the number of days of data I can store. (and be slower to write!?)

Thanks very much for all the hard work so far. Any pointers would also be gratefully received…

It’s already on the todo list, it’s just a lot of work to get JPEG decoding working, but I’ll see what I can do.

Hi,

Thanks, as I say I only need to be able to load the compressed image again, not actually decompress it. So even a way of loading a file onto the frame buffer would suffice.

You can already do this:

  1. Open the jpeg file and read it into a byte array.
  2. Create a extra frame buffer and set the image format type to the byte size of the byte array above.
  3. Use the bytearray() arg of an image and assign he byte array the image.

This works for small jpegs. It however doesn’t work for large ones (1MB etc). So, we need to add this.

I see, that’s a lot easier to implement. Okay please open an issue on github and I’ll get right on it.

Never mind, I already fixed it, you should be able to load jpg images in the next release. So this should work:

img = image.Image("/test.jpg", copy_to_fb=True)

Fantastic. That’s just what I am after. That’s outstanding support! Thankyou