X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/967eed676fc83d15b26149047f353ac61faa8217..a169ba7caa0d9d83fddcbad5ed05f536e0ca1b9e:/src/sponsors/models.py diff --git a/src/sponsors/models.py b/src/sponsors/models.py index 8b5055239..dbc9b7abc 100644 --- a/src/sponsors/models.py +++ b/src/sponsors/models.py @@ -66,14 +66,14 @@ class SponsorPage(models.Model): if simg.size[0] > THUMB_WIDTH or simg.size[1] > THUMB_HEIGHT: size = ( min(THUMB_WIDTH, - simg.size[0] * THUMB_HEIGHT / simg.size[1]), + round(simg.size[0] * THUMB_HEIGHT / simg.size[1])), min(THUMB_HEIGHT, - simg.size[1] * THUMB_WIDTH / simg.size[0]) + round(simg.size[1] * THUMB_WIDTH / simg.size[0])) ) simg = simg.resize(size, Image.ANTIALIAS) sprite.paste(simg, ( - (THUMB_WIDTH - simg.size[0]) / 2, - i * THUMB_HEIGHT + (THUMB_HEIGHT - simg.size[1]) / 2, + round((THUMB_WIDTH - simg.size[0]) / 2), + round(i * THUMB_HEIGHT + (THUMB_HEIGHT - simg.size[1]) / 2), )) imgstr = BytesIO() sprite.save(imgstr, 'png')