FAQ
Hello again

I'm still wrestling with Python / Tkinter / PIL. I have almost got it
to work - on a Fedora Core 1 system I can now display images in a
Tkinter window. But I also run a Fedora Core 3 system, and when I
tried the same procedures I get the following errors:-

[kpeter at localhost jpgTest]$ python pil_jpg.py
Exception in Tkinter callback
Traceback (most recent call last):
File "/usr/lib/python2.3/lib-tk/Tkinter.py", line 1345, in __call__
return self.func(*args)
File "pil_jpg.py", line 26, in do_something
a.thumbnail((200,150))
File "/usr/lib/python2.3/site-packages/PIL/Image.py", line 1422, in
thumbnail
self.load()
File "/usr/lib/python2.3/site-packages/PIL/ImageFile.py", line 180,
in load
d = Image._getdecoder(self.mode, d, a, self.decoderconfig)
File "/usr/lib/python2.3/site-packages/PIL/Image.py", line 328, in
_getdecoder
raise IOError("decoder %s not available" % decoder_name)
IOError: decoder jpeg not available

I am running Python 2.3.4, PIL 1.1.5 on a Fedora Core 3 system. I know
the code is ok, as it runs quite happily under FC1 and Windows. I've
searched around for clues, and found a few references to this error
message, but quite frankly don't understand what they are saying.

Searching around for files that look as if they may be the jpeg
libraries I can find
/usr/lib/libjpeg.so.62.0.0, and a symbolic link /usr/lib/libjpeg.so.62.
I think I somehow have to configure PIL to recognise these, but I am
not sure and anyway don't know how to do this.

Can anyone help?

Peter

Search Discussions

  • Peter Mosley at Feb 7, 2006 at 12:28 pm
    Someone out there must surely know - please!

    Peter
  • Steve Holden at Feb 7, 2006 at 12:46 pm

    peter.mosley at talk21.com wrote:
    Someone out there must surely know - please!

    Peter
    Try image-sig at python.org - or better still, subscribe to the image SIG
    mailing list (then you'll see replies ...)

    I've never had any problems loading JPEG images. It's probably a setup
    issue.

    regards
    Steve
    --
    Steve Holden +44 150 684 7255 +1 800 494 3119
    Holden Web LLC www.holdenweb.com
    PyCon TX 2006 www.python.org/pycon/
  • Andrew Gwozdziewycz at Feb 8, 2006 at 8:52 pm

    On 2/7/06, Steve Holden wrote:
    peter.mosley at talk21.com wrote:
    Someone out there must surely know - please!

    Peter
    Try building the PIL from scratch. It might give you some insight as
    to which library it exactly is looking for. I can remember when
    compiling the PIL on my mac having to create a symbolic link to
    libjpeg.so.6 or something. It was bizarre but worked fine afterwards.

    --
    Andrew Gwozdziewycz <apgwoz at gmail.com>
    http://ihadagreatview.org
    http://plasticandroid.org
  • Amit Khemka at Feb 9, 2006 at 6:47 am
    This is because PIL, is not able to find the jpeg library .

    1. Install jpeg-libs from sources: (http://www.ijg.org/files/jpegsrc.v6b.tar.gz)
    2.0: "clean" the PIL build
    2.1 In setup.py that comes with PIL, set the JPEG_ROOT to the jpeg-lib path
    3.0 run setup.py

    I hope that should help ..

    cheers,
    amit

    On 2/9/06, Andrew Gwozdziewycz wrote:
    On 2/7/06, Steve Holden wrote:
    peter.mosley at talk21.com wrote:
    Someone out there must surely know - please!

    Peter
    Try building the PIL from scratch. It might give you some insight as
    to which library it exactly is looking for. I can remember when
    compiling the PIL on my mac having to create a symbolic link to
    libjpeg.so.6 or something. It was bizarre but worked fine afterwards.

    --
    Andrew Gwozdziewycz <apgwoz at gmail.com>
    http://ihadagreatview.org
    http://plasticandroid.org
    --
    http://mail.python.org/mailman/listinfo/python-list

    --
    ----
    Amit Khemka -- onyomo.com
    Endless the world's turn, endless the sun's Spinning, Endless the quest;
    I turn again, back to my own beginning, And here, find rest.
  • Peter Mosley at Feb 9, 2006 at 8:59 am
    Thanks for that tip

    Following a dialogue in that discussion group it is now working. The
    problem was that I didn't have the right jpeg library installed
    (although what I had was enough to show jpegs in gThumb, GIMP and the
    Gnome and KDE desktops so I don't understand why it wasn't). I had to
    also install a jpeg development library, which fortunately was
    available on my Fedora Core 3 installation disc.

    A final glitch was that the previous broken build interfered with the
    linking of PIL to the libraries. I went for overkill, and deleted all
    the PIL installation and site-packages directories, then reinstalled
    from the original tarball. This gave a curious glitch, in that the
    first time I ran it it failed to load Tkinter with some obscure error
    message, but on a retry everything was fine. This worries me slightly,
    as I don't know what happened and there is always a chance it could
    happen again, but until it does I can't investigate it.

    Slightly off topic, but I think my experience here is typical of any
    installation on a Linux system, and illustrates why, despite huge
    improvements over the last few years, Linux is not yet really suitable
    for non expert use.

    Thanks to everyone who's helped me over the last few months.

    Peter
  • Scott David Daniels at Feb 9, 2006 at 2:02 pm

    peter.mosley at talk21.com wrote:
    .... The problem was that I didn't have the right jpeg library installed
    (although what I had was enough to show jpegs in gThumb, GIMP and the
    Gnome and KDE desktops so I don't understand why it wasn't). I had to
    also install a jpeg development library, which fortunately was
    available on my Fedora Core 3 installation disc....
    The problem is in the name chosen by _lots_ of distributions. A "jpeg
    developer library" or any other of the "development libraries" are not
    just for those who intend to "develop" jpeg, but really for those who
    "develop programs" -- that is run compilers and linkers. If you need
    to compile and link a program that uses one of these libraries, you need
    the "developer library." Even if the only sense in which you are a
    developer is that you are rebuilding Fredrik's code.

    --Scott David Daniels
    scott.daniels at acm.org
  • Gr at Feb 15, 2006 at 10:28 pm
    Peter,

    Can you share the name of the library on the Fedora distro?

    thx,

    gerry rodman
    http://www.gerryrodman.com/


    peter.mosley at talk21.com wrote:
    Thanks for that tip

    Following a dialogue in that discussion group it is now working. The
    problem was that I didn't have the right jpeg library installed
    (although what I had was enough to show jpegs in gThumb, GIMP and the
    Gnome and KDE desktops so I don't understand why it wasn't). I had to
    also install a jpeg development library, which fortunately was
    available on my Fedora Core 3 installation disc.

    A final glitch was that the previous broken build interfered with the
    linking of PIL to the libraries. I went for overkill, and deleted all
    the PIL installation and site-packages directories, then reinstalled
    from the original tarball. This gave a curious glitch, in that the
    first time I ran it it failed to load Tkinter with some obscure error
    message, but on a retry everything was fine. This worries me slightly,
    as I don't know what happened and there is always a chance it could
    happen again, but until it does I can't investigate it.

    Slightly off topic, but I think my experience here is typical of any
    installation on a Linux system, and illustrates why, despite huge
    improvements over the last few years, Linux is not yet really suitable
    for non expert use.

    Thanks to everyone who's helped me over the last few months.

    Peter
  • Gr at Feb 15, 2006 at 10:53 pm
    Found it...and will share.

    You need to install the "X Software Developement" library (standard
    only is enough) from you Fedora distro...not sure what will be required
    on other Linux distro's.

    Worked like a charm...thanks Peter.

    gerry rodman
    http://www.gerryrodman.com/
  • Peter Mosley at Feb 16, 2006 at 11:07 pm
    Can you share the name of the library on the Fedora distro?

    file:///media/cdrecorder/Fedora/RPMS/libjpeg-devel-6b-33.i386.rpm

    On disc 3 in my copy, but that probably doesn't mean anything!

    Peter

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppython-list @
categoriespython
postedFeb 6, '06 at 9:58p
activeFeb 16, '06 at 11:07p
posts10
users6
websitepython.org

People

Translate

site design / logo © 2022 Grokbase