Skip to content

Commit d0767a1

Browse files
authored
fix comment and style for quality range checking
Fix comment and style for quality range checking Comments on lines: 1490, 1497 use range verbiage such as: """Controls the JPEG quality. Valid range is from 2..55 inclusive""" However, 55 is not included. Also, the check on 1495 uses the following checking style using '<': if not 2 <= value < 55:
1 parent d2b84ed commit d0767a1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

adafruit_ov5640/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1487,14 +1487,14 @@ def effect(self, value: int) -> None:
14871487

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

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

0 commit comments

Comments
 (0)