[FIX] Image resizing bug

This commit is contained in:
Fabien Meghazi 2014-09-17 17:36:09 +02:00
parent 3f4ff3e725
commit 57ad514bb2
1 changed files with 1 additions and 0 deletions

View File

@ -108,6 +108,7 @@ def image_resize_and_sharpen(image, size, factor=2.0):
if image.mode != 'RGBA':
image = image.convert('RGBA')
image.thumbnail(size, Image.ANTIALIAS)
size = image.size
sharpener = ImageEnhance.Sharpness(image)
resized_image = sharpener.enhance(factor)
# create a transparent image for background and paste the image on it