mirror of
https://github.com/Kakune55/ComiPy.git
synced 2025-05-06 18:29:26 +08:00
fix:修复了缩放过程中图片比例错误的问题
This commit is contained in:
parent
007645e94d
commit
0283dbb1e6
2
file.py
2
file.py
@ -74,7 +74,7 @@ def thumbnail(input, minSize: int = 600):
|
||||
if height < width:
|
||||
newshape = (int(minSize / width * height), minSize)
|
||||
else:
|
||||
newshape = (minSize, int(minSize / width * height))
|
||||
newshape = (minSize, int(minSize / height * width))
|
||||
img = cv2.resize(img, newshape)
|
||||
success, encoded_image = cv2.imencode(".webp", img, [cv2.IMWRITE_WEBP_QUALITY, 75])
|
||||
return encoded_image.tobytes()
|
||||
|
@ -1,3 +1,4 @@
|
||||
shortuuid
|
||||
flask
|
||||
opencv-python
|
||||
opencv-python-headless
|
@ -28,7 +28,7 @@
|
||||
img {
|
||||
display: block;
|
||||
width: 100%;
|
||||
min-height: 300px;
|
||||
min-height: 200px;
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user