mirror of
https://github.com/jazzband/django-avatar.git
synced 2026-05-23 14:45:49 +00:00
Preserve RGBA image.mode
This commit is contained in:
parent
206682ce0a
commit
c1f278bb84
1 changed files with 1 additions and 1 deletions
|
|
@ -103,7 +103,7 @@ class Avatar(models.Model):
|
|||
else:
|
||||
diff = int((h - w) / 2)
|
||||
image = image.crop((0, diff, w, h - diff))
|
||||
if image.mode != "RGB":
|
||||
if image.mode not in ("RGB", "RGBA"):
|
||||
image = image.convert("RGB")
|
||||
image = image.resize((size, size), settings.AVATAR_RESIZE_METHOD)
|
||||
thumb = six.BytesIO()
|
||||
|
|
|
|||
Loading…
Reference in a new issue