adafruit / Adafruit_CircuitPython_PyCamera

Library for the Adafruit PyCamera
https://docs.circuitpython.org/projects/pycamera
MIT License
17 stars 9 forks source link

Allow capturing a JPEG into a bytes object #13

Closed brentru closed 11 months ago

brentru commented 11 months ago

While capture_into_bitmap() exists, it produces a bmp too large for sending over MQTT . This PR factors out the capture into memory buffer code from capture_jpeg() as capture_into_jpeg(), which returns a bytes object if the capture was successful otherwise None (return type must be checked from user-code).

brentru commented 11 months ago

we might want to make the mode switching lazy someday, or re-use capture_into_jpeg from capture_jpeg, but this is a good start with a handy feature

Yeah, I was considering that