Mercurial > libervia-backend
comparison src/plugins/plugin_xep_0054.py @ 2506:516bf5309517
plugin XEP-0054: removed Image.ANTIALIAS filter:
Image.ANTIALIAS filter is not needed anymore in Pillow: http://pillow.readthedocs.io/en/3.0.x/releasenotes/2.7.0.html#default-filter-for-thumbnails
author | Goffi <goffi@goffi.org> |
---|---|
date | Thu, 01 Mar 2018 09:04:36 +0100 |
parents | 0046283a285d |
children | 4001aa395a04 |
comparison
equal
deleted
inserted
replaced
2505:8e770ac05b0c | 2506:516bf5309517 |
---|---|
443 img = Image.open(file_path) | 443 img = Image.open(file_path) |
444 except IOError: | 444 except IOError: |
445 return Failure(exceptions.DataError(u"Can't open image")) | 445 return Failure(exceptions.DataError(u"Can't open image")) |
446 | 446 |
447 if img.size != AVATAR_DIM: | 447 if img.size != AVATAR_DIM: |
448 img.thumbnail(AVATAR_DIM, Image.ANTIALIAS) | 448 img.thumbnail(AVATAR_DIM) |
449 if img.size[0] != img.size[1]: # we need to crop first | 449 if img.size[0] != img.size[1]: # we need to crop first |
450 left, upper = (0, 0) | 450 left, upper = (0, 0) |
451 right, lower = img.size | 451 right, lower = img.size |
452 offset = abs(right - lower) / 2 | 452 offset = abs(right - lower) / 2 |
453 if right == min(img.size): | 453 if right == min(img.size): |