Scale and Crop instead of Stretch
This commit is contained in:
parent
13de820e34
commit
c1e8a8c2e4
@ -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
|
||||||
|
@ -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>
|
||||||
|
Loading…
Reference in New Issue
Block a user