>From what I can tell your not wrapping the thumbnail file in
ContentFile your just returning the raw file from the string IO.  To
use the the ImageField django provides you must provide it with a file
that is in a special wrapper called ContentFile.  I would suggest
trying this:

from django.core.files.base import ContentFile   (import this function
at the top of your view or where ever you put def resize_image)

change the last line of def resize_image from "return o.getvalue()" to
"return ContentFile(o.getvalue())"

I would also recommend changing "new_profile.picture.save(filename,
thumbnail_content)" to "new_profile.picture.save(filename,
thumbnail_content, save=False)" so that you are not hitting the
database twice.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to