mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-04-09 00:27:37 +03:00
Fix quality=0 handling
Co-authored-by: Josh Hawkins <32435876+hawkeye217@users.noreply.github.com>
This commit is contained in:
parent
3a7766ddbd
commit
0ad8fff9f9
@ -272,7 +272,7 @@ def draw_box_with_label(
|
|||||||
|
|
||||||
def get_image_quality_params(ext: str, quality: Optional[int]) -> list[int]:
|
def get_image_quality_params(ext: str, quality: Optional[int]) -> list[int]:
|
||||||
if ext in ("jpg", "jpeg"):
|
if ext in ("jpg", "jpeg"):
|
||||||
return [int(cv2.IMWRITE_JPEG_QUALITY), quality or 70]
|
return [int(cv2.IMWRITE_JPEG_QUALITY), quality if quality is not None else 70]
|
||||||
|
|
||||||
if ext == "webp":
|
if ext == "webp":
|
||||||
return [int(cv2.IMWRITE_WEBP_QUALITY), quality or 60]
|
return [int(cv2.IMWRITE_WEBP_QUALITY), quality or 60]
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user