mirror of
https://github.com/Kakune55/ComiPy.git
synced 2025-09-16 04:09:41 +08:00
feat:新增图像编码设置
This commit is contained in:
2
file.py
2
file.py
@@ -79,7 +79,7 @@ def thumbnail(input, minSize: int = 600, encode:str="webp"):
|
||||
img = cv2.resize(img, newshape)
|
||||
if encode == "webp":
|
||||
success, encoded_image = cv2.imencode(".webp", img, [cv2.IMWRITE_WEBP_QUALITY, 75])
|
||||
elif encode == "jpg":
|
||||
elif encode == "jpg" or "jpeg":
|
||||
success, encoded_image = cv2.imencode(".jpg", img, [cv2.IMWRITE_JPEG_QUALITY, 75])
|
||||
else:
|
||||
return input
|
||||
|
Reference in New Issue
Block a user