Skip to content

Commit 654fd7f

Browse files
authored
Merge pull request #36 from casten/patch-1
Improve comment and style for quality range checking
2 parents 78152bb + 3f7152c commit 654fd7f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

adafruit_ov5640/__init__.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -1489,14 +1489,14 @@ def effect(self, value: int) -> None:
14891489

14901490
@property
14911491
def quality(self) -> int:
1492-
"""Controls the JPEG quality. Valid range is from 2..55 inclusive"""
1492+
"""Controls the JPEG quality. Valid range is from 2..54 inclusive"""
14931493
return self._read_register(_COMPRESSION_CTRL07) & 0x3F
14941494

14951495
@quality.setter
14961496
def quality(self, value: int) -> None:
1497-
if not 2 <= value < 55:
1497+
if not 2 <= value <= 54:
14981498
raise ValueError(
1499-
f"Invalid quality value {value}, use a value from 2..55 inclusive"
1499+
f"Invalid quality value {value}, use a value from 2..54 inclusive"
15001500
)
15011501
self._write_register(_COMPRESSION_CTRL07, value & 0x3F)
15021502

0 commit comments

Comments
 (0)