aamalig / django-profile

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

IOError: cannot write mode P as JPEG #54

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I got an IOError after uploading and trying to display an avatar.

TemplateSyntaxError at /

Caught an exception while rendering: cannot write mode P as JPEG

Original Traceback (most recent call last):
  File
"/home/andre/Progz/womanpower/lib/python2.5/site-packages/django/template/debug.
py",
line 71, in render_node
    result = node.render(context)
  File
"/home/andre/Progz/womanpower/lib/python2.5/site-packages/userprofile/templateta
gs/avatars.py",
line 59, in render
    image.save(filename, "JPEG")
  File "/usr/lib/python2.5/site-packages/PIL/Image.py", line 1405, in save
    save_handler(self, fp, filename)
  File "/usr/lib/python2.5/site-packages/PIL/JpegImagePlugin.py", line 390,
in _save
    raise IOError("cannot write mode %s as JPEG" % im.mode)
IOError: cannot write mode P as JPEG

= What steps will reproduce the problem? =
1. Upload the attached gif file
2. Try to display it

= What is the expected output? What do you see instead? =
Should see the image converted in jpeg but the image is not converted and I
got this IOError instead.

= What version of the product are you using? On what operating system? =
 * Django-profile 0.6
 * Django 1.0.2
 * Python 2.5.2
 * Python Imaging 1.1.6
 * Gentoo Linux (kernel vanilla 2.6.29)

= Please provide any additional information below. =
The attached patch should fix this issue.
$ tar -xvzf django-profile-0.6.tgz
$ cp avatars_IOError.patch django-profile/
$ cd django-profile/
$ patch -p0 -i avatars_IOError.patch

Original issue reported on code.google.com by andre.mi...@gmail.com on 18 Apr 2009 at 7:29

Attachments:

GoogleCodeExporter commented 8 years ago
corrected in r443

Original comment by stephane.angel on 26 Apr 2010 at 4:28