Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -39,7 +39,7 @@ def imageprepare(argv,Single):
|
|
| 39 |
if (nheight == 0): # rare case but minimum is 1 pixel
|
| 40 |
nheight = 1
|
| 41 |
# resize and sharpen
|
| 42 |
-
img = im.resize((20, nheight), Image.
|
| 43 |
wtop = int(round(((28 - nheight) / 2), 0)) # calculate horizontal position
|
| 44 |
newImage.paste(img, (4, wtop)) # paste resized image on white canvas
|
| 45 |
else:
|
|
|
|
| 39 |
if (nheight == 0): # rare case but minimum is 1 pixel
|
| 40 |
nheight = 1
|
| 41 |
# resize and sharpen
|
| 42 |
+
img = im.resize((20, nheight), Image.Resampling.LANCZOS).filter(ImageFilter.SHARPEN)
|
| 43 |
wtop = int(round(((28 - nheight) / 2), 0)) # calculate horizontal position
|
| 44 |
newImage.paste(img, (4, wtop)) # paste resized image on white canvas
|
| 45 |
else:
|