Fix image thumbnail wrong variable bug.
How long has that been there?
This commit is contained in:
parent
5ac3a8a121
commit
bbf07f4401
1 changed files with 4 additions and 4 deletions
|
@ -156,14 +156,14 @@ def fit_into_bounds(image_width, image_height, frame_width, frame_height):
|
||||||
|
|
||||||
def generate_image_thumbnail(filepath, width, height):
|
def generate_image_thumbnail(filepath, width, height):
|
||||||
image = PIL.Image.open(filepath)
|
image = PIL.Image.open(filepath)
|
||||||
(width, height) = image.size
|
(image_width, image_height) = image.size
|
||||||
(new_width, new_height) = fit_into_bounds(
|
(new_width, new_height) = fit_into_bounds(
|
||||||
image_width=width,
|
image_width=image_width,
|
||||||
image_height=height,
|
image_height=image_height,
|
||||||
frame_width=width,
|
frame_width=width,
|
||||||
frame_height=height,
|
frame_height=height,
|
||||||
)
|
)
|
||||||
if new_width < width:
|
if new_width < image_width or new_height < image_height:
|
||||||
image = image.resize((new_width, new_height))
|
image = image.resize((new_width, new_height))
|
||||||
|
|
||||||
if image.mode == 'RGBA':
|
if image.mode == 'RGBA':
|
||||||
|
|
Loading…
Reference in a new issue