Commit 8cfedbb1 authored by Thom Wiggers's avatar Thom Wiggers 📐
Browse files

Merge branch 'fix/thumbnail-same-size' into 'master'

Fix thumbnailing of images to same size as source

Closes #873

See merge request !1265
parents 44979b0b a2af8995
......@@ -87,6 +87,10 @@ def generate_thumbnail(request, request_path):
if not sig_info['fit']:
ratio = min([a / b for a, b in zip(size, image.size)])
size = tuple(int(ratio * x) for x in image.size)
if size[0] == image.size[0] and size[1] == image.size[1]:
image.save(full_thumb_path)
else:
thumb = ImageOps.fit(image, size, Image.ANTIALIAS)
thumb.save(full_thumb_path)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment