PIL question - saving JPEG

N

news.west.cox.net

I have a fairly simple Python program that uses Image and ImageDraw to
create poll results on the fly.

Because PIL only supports 256 colors for GIF and BMPs are huge (in
comparison)... I have opted to create JPEGs.

I have installed JPEG-6b and have checked to see that all of the libraries
are in the correct, expected places. But, I am still getting the following
error.

IOError: encoder jpeg not available

Anyone with some PIL experience know how to get this working? I really
appreciate any help offered.

If you need more information, just ask. I will be checking this post for
the next few days.
 
F

Fredrik Lundh

news.west.cox.net said:
I have a fairly simple Python program that uses Image and ImageDraw to create poll results on the
fly.

Because PIL only supports 256 colors for GIF and BMPs are huge (in comparison)... I have opted to
create JPEGs.

I have installed JPEG-6b and have checked to see that all of the libraries are in the correct,
expected places. But, I am still getting the following error.

IOError: encoder jpeg not available

have you verified that PIL's build process was able to find and link against
the JPEG libraries? here's how to fix this in 1.1.4 and earlier:

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

for 1.1.5, setting the JPEG_ROOT variable in the setup.py file should do
the trick. see comments in that file for details.

</F>
 
N

news.west.cox.net

Fredrik Lundh said:
have you verified that PIL's build process was able to find and link
against
the JPEG libraries? here's how to fix this in 1.1.4 and earlier:

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

for 1.1.5, setting the JPEG_ROOT variable in the setup.py file should do
the trick. see comments in that file for details.

</F>

Thanks for the link. However, after completing the list of changes, and
reconfiguring, remaking, rebuilding and reinstalling... still no luck.

I will try again tomorrow when I have regained a little bit of patience. If
there are any other links like this one out there I would love to give it a
shot too.

Thanks for any help.
 
N

news.west.cox.net

Got it working.

I needed to copy the PIL directory intp site-packages/PIL...
apparently the pyc files do not get recreated automatically.
 
J

Josiah Carlson

Got it working.

I needed to copy the PIL directory intp site-packages/PIL...
apparently the pyc files do not get recreated automatically.

.pyc files are created from .py files, but if you only have .pyc files,
Python will work with them.

I would bet there weren't any .py files in site-packages/PIL.

- Josiah
 
C

Christos TZOTZIOY Georgiou

I have a fairly simple Python program that uses Image and ImageDraw to
create poll results on the fly.
Because PIL only supports 256 colors for GIF and BMPs are huge (in
comparison)... I have opted to create JPEGs.

Another option is to use the PNG format, especially since you create
graphs. PNGs have better quality and compression for this type of
images.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,817
Latest member
DicWeils

Latest Threads

Top