Skip to content

Commit 3f7152c

Browse files
authored
Merge branch 'jerryneedell:main' into patch-1
2 parents d0767a1 + 78152bb commit 3f7152c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

adafruit_ov5640/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1236,7 +1236,9 @@ def capture(self, buf: Union[bytearray, memoryview]) -> None:
12361236
def capture_buffer_size(self) -> int:
12371237
"""Return the size of capture buffer to use with current resolution & colorspace settings"""
12381238
if self.colorspace == OV5640_COLOR_JPEG:
1239-
return self.width * self.height // self.quality
1239+
# This is somewhat arbirary but seems to work for a wide range of JPEG images
1240+
# the user can chose to further scale the buffer in the user code if necessary
1241+
return 2 * (self.width * self.height // self.quality)
12401242
if self.colorspace == OV5640_COLOR_GRAYSCALE:
12411243
return self.width * self.height
12421244
return self.width * self.height * 2

0 commit comments

Comments
 (0)