Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Addresses #29
Change the calculation of the JPEG capture buffer to avoid corrupted captures.
the old calculation was width*height/quality
but this often resulted in the buffer being too small, especially for higher quality (lower resolution) images.
the new calculation doubles the size:
2*width*height/quality
This may be overkill, but does seem to work over a wide range of JPEG sizes and qualities.
We can discuss reducing it and accept more risk of errors.
setting the buffer to
width*height//5
also seems to work, but seems very difficult to explain...These changes were tested with a Pico2W.
Using a PicoW there are still severe memory constraints. I was only able to use JPEG images of 160x120 (QQVGA)
I was also able to capture JPEG images and write to an SD on a Pico.
Using the PicoW to capture an image and send it to AIO was not viable, in my experience.
That is why I moved to the Pico2W to work on this.