aamalig / django-profile

Automatically exported from code.google.com/p/django-profile
BSD 2-Clause "Simplified" License
0 stars 0 forks source link

Caught error while rendering avatar. #80

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Registered a new user but didn't upload a avatar
2. It raised "Caught an exception while rendering: cannot identify image 
file" when I was trying to access the profile page.

I use the trunk version.

Please provide any additional information below.

I found the templatetags/avatar.py
except:
            avatar_path = DEFAULT_AVATAR
            avatar = open(avatar_path)
                .
                .
                .
thumb = Image.open(ContentFile(avatar.read()))

These code doesn't work.

It works when I modify the codes as:
thumb = Image.open(avatar_path)

but this is very dangling patch and will not work while in the other 
situation.

Original issue reported on code.google.com by Steven.N...@gmail.com on 24 Apr 2010 at 4:14

GoogleCodeExporter commented 8 years ago
Image.open(avatar_path) won't work with S3Storage i think ( i didn't use it btw)

I can't reproduce the problem. Do you have a DEFAULT_AVATAR in your settings ?

Original comment by stephane.angel on 26 Apr 2010 at 3:53

GoogleCodeExporter commented 8 years ago
I was having this issue too, modify:
avatar = open(avatar_path)
to:
avatar = open(avatar_path,'rb')

and will solve..

Original comment by glebi...@gmail.com on 8 Jun 2010 at 8:34