mirror of
https://github.com/jazzband/django-avatar.git
synced 2026-03-16 22:20:30 +00:00
Fixed problem with uploading .GIF files, as they need to be conditionally converted to RGB.
git-svn-id: http://django-avatar.googlecode.com/svn/trunk@23 c76b2324-5f53-0410-85ac-b1078a54aeeb
This commit is contained in:
parent
d29ebe0192
commit
559eb4ae99
1 changed files with 2 additions and 0 deletions
|
|
@ -64,6 +64,8 @@ class Avatar(models.Model):
|
|||
image = image.crop((0, diff, w, h - diff))
|
||||
image = image.resize((size, size), AVATAR_RESIZE_METHOD)
|
||||
thumb = default_storage.open(self.avatar_path(size), 'wb')
|
||||
if image.mode != "RGB":
|
||||
image = image.convert("RGB")
|
||||
image.save(thumb, "JPEG")
|
||||
|
||||
def avatar_url(self, size):
|
||||
|
|
|
|||
Loading…
Reference in a new issue