Scale and Crop instead of Stretch

This commit is contained in:
Alex Xu 2021-03-24 20:51:21 -07:00
parent 13de820e34
commit c1e8a8c2e4
2 changed files with 3 additions and 5 deletions

View File

@ -16,7 +16,7 @@
import os import os
from PIL import Image, ImageDraw, ImageStat, ImageChops from PIL import Image, ImageDraw, ImageStat, ImageChops, ImageOps
class ImageFlags: class ImageFlags:
@ -135,9 +135,7 @@ def quantizeImage(image, palette):
@protect_bad_image @protect_bad_image
def stretchImage(image, size): def stretchImage(image, size):
widthDev, heightDev = size return ImageOps.fit(image, size, Image.ANTIALIAS)
return image.resize((widthDev, heightDev), Image.ANTIALIAS)
@protect_bad_image @protect_bad_image

View File

@ -217,7 +217,7 @@
<item> <item>
<widget class="QRadioButton" name="checkboxStretch"> <widget class="QRadioButton" name="checkboxStretch">
<property name="text"> <property name="text">
<string>Stretch images to fill the screen</string> <string>Scale and crop images to fill the screen</string>
</property> </property>
</widget> </widget>
</item> </item>