PIL decoder jpeg not available

69 views
Skip to first unread message

Pierre

unread,
Sep 22, 2009, 11:14:36 AM9/22/09
to sage-support
hi all,

i've install the PIL with

sage -i pil-1.1.6

Seems to work. However when trying the following:

import Image
im= Image.open("foo.jpg")
im.convert("L") #should convert to B&W i think

i get "decoder jpeg not available". It seems that the reason this
happens is explained here :

http://effbot.org/zone/pil-decoder-jpeg-not-available.htm

unfortunately, not having installed the PIL manually with a setup.py,
i don't know what to do.

Help anyone ? thanks !
Pierre

Marshall Hampton

unread,
Sep 22, 2009, 10:07:45 PM9/22/09
to sage-support
What operating system are you using?

-M. Hampton

Pierre

unread,
Sep 23, 2009, 12:15:20 PM9/23/09
to sage-support
Mac OS X. Sage was compiled from source.

This all seems like a path problem, really.

Pierre

unread,
Sep 24, 2009, 10:22:39 AM9/24/09
to sage-support
Is it just me then ? can everyone else use the PIL with jpeg ? i've
got two macs with a slightly different version of leopard, this fails
on both.

wdjoyner

unread,
Sep 24, 2009, 11:56:07 AM9/24/09
to sage-s...@googlegroups.com
I think this is a mac issue. It does not happen for me in linux.
I'd be very interested in a solution (preferably a very simple one:-)
since I have a mac as well and have experienced the same problem
you reported.

Pierre

unread,
Sep 24, 2009, 12:46:17 PM9/24/09
to sage-support
well one crappy solution is use convert, from the imagemagik suite,
which ships with every mac:

sage: %convert image.jpg new_image.png

... but of course that's not ideal.

On 24 sep, 17:56, wdjoyner <wdjoy...@gmail.com> wrote:
> I think this is a mac issue. It does not happen for me in linux.
> I'd be very interested in a solution (preferably a very simple one:-)
> since I have a mac as well and have experienced the same problem
> you reported.
>

Marshall Hampton

unread,
Sep 24, 2009, 1:48:53 PM9/24/09
to sage-support, sage-...@googlegroups.com
I'm pretty sure I've fixed this once on a mac, but unfortunately I
can't remember what I did. In fact, sadly, I'm not sure I knew what I
did at the time, I just kept trying different things I until it
worked.

From your original link, I think we just have to correctly do option
5, i.e. edit the setup.py file with:

# add jpeg directories
INCLUDE_DIRS.append("/somelib/include")
LIBRARY_DIRS.append("/somelib/lib")

..after detecting that its a Darwin system. I am forwarding this to
sage-devel in the hopes that someone there might be able to
immediately know how to fix this.

-M. Hampton
Reply all
Reply to author
Forward
0 new messages