From 0283dbb1e650a2af57a444e46f9e917b0c1473d0 Mon Sep 17 00:00:00 2001 From: Kakune55 Date: Thu, 9 May 2024 11:48:09 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E4=BF=AE=E5=A4=8D=E4=BA=86=E7=BC=A9?= =?UTF-8?q?=E6=94=BE=E8=BF=87=E7=A8=8B=E4=B8=AD=E5=9B=BE=E7=89=87=E6=AF=94?= =?UTF-8?q?=E4=BE=8B=E9=94=99=E8=AF=AF=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- file.py | 2 +- requirements.txt | 3 ++- templates/view.html | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/file.py b/file.py index e478490..11c0bf6 100644 --- a/file.py +++ b/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() diff --git a/requirements.txt b/requirements.txt index b7a17c1..fc6c551 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,4 @@ shortuuid flask -opencv-python \ No newline at end of file +opencv-python +opencv-python-headless \ No newline at end of file diff --git a/templates/view.html b/templates/view.html index 7b0a733..bcd79c1 100644 --- a/templates/view.html +++ b/templates/view.html @@ -28,7 +28,7 @@ img { display: block; width: 100%; - min-height: 300px; + min-height: 200px; margin-top: 10px; }