-
Notifications
You must be signed in to change notification settings - Fork 6
Improve comment and style for quality range checking #36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
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:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would 55 work? I wonder if the < 55
is a bug, as opposed to <= 55
I do not know if the hardware would be happy with 55. But the driver is certainly unhappy: cam.quality = 55
print(f"Attempting to use quality {quality}.")
b = bytearray(cam.capture_buffer_size)
jpeg = cam.capture(b) produces:
If we want to match the style used for saturation and 55 is invalid for quality, we should change the comment to say "54 inclusive" and use '<='. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
Updating https://github.com/adafruit/Adafruit_CircuitPython_DisplayIO_SH1107 to 2.0.2 from 2.0.1: > Merge pull request adafruit/Adafruit_CircuitPython_DisplayIO_SH1107#28 from RetiredWizard/main Updating https://github.com/adafruit/Adafruit_CircuitPython_INA3221 to 1.1.0 from 1.0.1: > Merge pull request adafruit/Adafruit_CircuitPython_INA3221#1 from bablokb/refactor Updating https://github.com/adafruit/Adafruit_CircuitPython_OV5640 to 1.2.5 from 1.2.4: > Merge pull request adafruit/Adafruit_CircuitPython_OV5640#36 from casten/patch-1 Updating https://github.com/adafruit/Adafruit_CircuitPython_RA8875 to 3.1.23 from 3.1.22: > Merge pull request adafruit/Adafruit_CircuitPython_RA8875#33 from makermelissa/master Updating https://github.com/adafruit/Adafruit_CircuitPython_TLV320 to 1.1.0 from 1.0.2: > Merge pull request adafruit/Adafruit_CircuitPython_TLV320#7 from adafruit/add_reset > Merge pull request adafruit/Adafruit_CircuitPython_TLV320#6 from adafruit/volume_update Updating https://github.com/adafruit/Adafruit_CircuitPython_Pathlib to 1.0.2 from 1.0.1: > Merge pull request adafruit/Adafruit_CircuitPython_Pathlib#1 from FoamyGuy/fix_error_num
Improve 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: