Scale and Crop instead of Stretch
This commit is contained in:
parent
13de820e34
commit
c1e8a8c2e4
@ -16,7 +16,7 @@
|
||||
|
||||
import os
|
||||
|
||||
from PIL import Image, ImageDraw, ImageStat, ImageChops
|
||||
from PIL import Image, ImageDraw, ImageStat, ImageChops, ImageOps
|
||||
|
||||
|
||||
class ImageFlags:
|
||||
@ -135,9 +135,7 @@ def quantizeImage(image, palette):
|
||||
|
||||
@protect_bad_image
|
||||
def stretchImage(image, size):
|
||||
widthDev, heightDev = size
|
||||
|
||||
return image.resize((widthDev, heightDev), Image.ANTIALIAS)
|
||||
return ImageOps.fit(image, size, Image.ANTIALIAS)
|
||||
|
||||
|
||||
@protect_bad_image
|
||||
|
@ -217,7 +217,7 @@
|
||||
<item>
|
||||
<widget class="QRadioButton" name="checkboxStretch">
|
||||
<property name="text">
|
||||
<string>Stretch images to fill the screen</string>
|
||||
<string>Scale and crop images to fill the screen</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
Loading…
Reference in New Issue
Block a user