mirror of
https://github.com/jazzband/django-avatar.git
synced 2026-03-16 22:20:30 +00:00
Fix for issue #12 on ericflo/django-avatar, proposed by fakeempire
Signed-off-by: Jannis Leidel <jannis@leidel.info>
This commit is contained in:
parent
9b9ca4a665
commit
32b61553d2
1 changed files with 1 additions and 1 deletions
|
|
@ -99,9 +99,9 @@ class Avatar(models.Model):
|
|||
else:
|
||||
diff = (h - w) / 2
|
||||
image = image.crop((0, diff, w, h - diff))
|
||||
image = image.resize((size, size), AVATAR_RESIZE_METHOD)
|
||||
if image.mode != "RGB":
|
||||
image = image.convert("RGB")
|
||||
image = image.resize((size, size), AVATAR_RESIZE_METHOD)
|
||||
thumb = StringIO()
|
||||
image.save(thumb, AVATAR_THUMB_FORMAT, quality=quality)
|
||||
thumb_file = ContentFile(thumb.getvalue())
|
||||
|
|
|
|||
Loading…
Reference in a new issue