> I am writing a site that has profile functionality which uses the
> sorl.thumbnail app. When I try to view a single user profile the image
> (a jpeg using sorl.thumbnail) works, beautifully.
>
> However, when I try to view all user profiles I get the following
> error:
>
> IOError at /profile/all/
> decoder jpeg not available
> Request Method:         GET
> Request URL:    http://www.theslushpile.com/profile/all/
> Exception Type:         IOError
> Exception Value:        decoder jpeg not available
> Exception Location:     /usr/lib/python2.3/site-packages/PIL/Image.py in
> _getdecoder, line 375
> Python Executable:      /usr/bin/python
> Python Version:         2.3.4
> Python Path:    ['', '/home/default/theslushpile.com/user/htdocs', '/usr/
> lib/python2.3/site-packages/django', '/usr/lib/python2.3/site-packages/
> MySQL_python-1.2.2-py2.3-linux-i686.egg', '/usr/lib/python2.3/site-
> packages/setuptools-0.6c8-py2.3.egg', '/usr/lib/python2.3/site-
> packages/pysqlite-2.4.1-py2.3-linux-i686.egg', '/usr/lib/
> python23.zip', '/usr/lib/python2.3', '/usr/lib/python2.3/plat-linux2',
> '/usr/lib/python2.3/lib-tk', '/usr/lib/python2.3/lib-dynload', '/usr/
> lib/python2.3/site-packages', '/usr/lib/python2.3/site-packages/PIL']
>
> Bizarrely, if I run selftest.py from PIL, I get:
>
> Failure in example: _info(Image.open("Images/lena.jpg"))
> from line #24 of selftest.testimage
> Exception raised:
> Traceback (most recent call last):
>   File "./doctest.py", line 499, in _run_examples_inner
>     exec compile(source, "<string>", "single") in globs
>   File "<string>", line 1, in ?
>   File "./selftest.py", line 22, in _info
>     im.load()
>   File "PIL/ImageFile.py", line 180, in load
>     d = Image._getdecoder(self.mode, d, a, self.decoderconfig)
>   File "PIL/Image.py", line 375, in _getdecoder
>     raise IOError("decoder %s not available" % decoder_name)
> IOError: decoder jpeg not available
> 1 items had failures:
>    1 of  57 in selftest.testimage
> ***Test Failed*** 1 failures.
> *** 1 tests of 57 failed.
>
> So how is it working for the single jpeg image? I believe that the
> jpeg library is present, (in /usr/local/lib , libjpeg.a -  the single
> jpeg test works...)although I am unsure how to force PIL setup.py to
> pick it up and use it.
>
> Any help much appreciated. I am going insane.

Don't worry: the world is insane enough as it is, so we (including
yourself) won't notice the difference anyway.

Not sure if I can help though, but have you tried the usual
'debugging' route:
1/ importing PIL and executing some basic commands from the Python
shell (NOT from the PIL install directory or your Django directory;
just, say, from your home dir). The commands should probably the ones
that you use in your "thumbnail" extension.
2/ check if there are *any* differences in the commands you execute
(eg in the template) for the single user profile and for the 'all'
template.
3/ check your LIBRARY_PATH. It very likely will include /usr/local/
lib, but may just not do that.
4/ try to clear anything that may be cached (django, browser).

Option 2 and 4 are the only ones I can think of that explain the
difference between the single user profile result and that of the
'all' template.

If you want to reinstall PIL and point it to the (correct?) PIL
library, check the README file: it is mentioned, although you get
redirected to the setup.py file itself:
README:
"
   If the build script won't find a given component, you can edit the
   setup.py file and set the appropriate ROOT variable.  For details,
   see instructions in the file.
"
and the setup.py:
"
# JPEG_ROOT = "/home/libraries/jpeg-6b"
.
.
.
JPEG_ROOT = None

"

Let us know the result; maybe that will put you and us on the right
track solving this.

Additional questions: what platform/OS? Looks like Linux. What libjpeg
version? How are you running Django: standalone server or through
another server?
(Most of this won't be directly relevant, but it may help.)

Good luck,

  Evert
--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to