473,473 Members | 1,889 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

PIL question - saving JPEG

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.

Jul 18 '05 #1
5 6303
"news.west.cox.net" wrote:
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-j...-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>

Jul 18 '05 #2

"Fredrik Lundh" <fr*****@pythonware.com> wrote in message
news:ma**************************************@pyth on.org...
"news.west.cox.net" wrote:
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-j...-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.


Jul 18 '05 #3
Got it working.

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

"news.west.cox.net" <se*********@cox.net> wrote in message
news:mphad.42310$a85.20380@fed1read04...
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.

Jul 18 '05 #4

On Tue, 12 Oct 2004 17:40:36 -0700
"news.west.cox.net" <se*********@cox.net> wrote:

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

Jul 18 '05 #5
On Sun, 10 Oct 2004 14:00:40 -0700, rumours say that "news.west.cox.net"
<se*********@cox.net> might have written:
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.
--
TZOTZIOY, I speak England very best,
"Tssss!" --Brad Pitt as Achilles in unprecedented Ancient Greek
Jul 18 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Michael Johnston | last post by:
I am saving a BufferedImage as a JPEG file under Windows XP. I am using the JAI JPEGImageEncoder class. The JPEG is saved as CMYK but I need RGB. I cannot figure out how to get RGB. Any help?
3
by: cdj | last post by:
Hi all, I've got a picturebox on a form, and a save button. When I go to save, the app craps out with the following error: ================== An unhandled exception of type...
4
by: CodeRazor | last post by:
I'm unfamiliar with image manipulation using c#. How can i resize a jpg that currently exists in a file and save it resized as a new file. The examples i've found have been a bit misleading for...
7
by: Marc Pelletier | last post by:
Hello all, I have a class which includes a method to create a chart. I want to be able to call this method from asp.net code as well as windows application code, so I have sketched it out as...
2
by: asad | last post by:
Hello friends, how ru all, i have some problem about saving created thumbnail, following is the code i use for creating thumbnail but thumbnail was not saved it is on memory which method is used to...
2
by: Brad | last post by:
I have code which takes an image, uploaded from a web page, and saves it to a database. Now I want to always resize an uploaded image before it is saved to the database. My code to resize is...
5
by: TheGanjaMan | last post by:
Hi everyone, I'm trying to write up a simple image stamper application that stamps the Exif date information from the jpegs that I've taken from my digital camera and saves the new file with the...
6
by: NutsAboutVB | last post by:
Hello, I am a .NET programmer and I have a JPEG image file (from digital camera) of about 109 KB's in size, when I open it and save it (without making any alterations at all, just going to File...
7
by: pamela fluente | last post by:
I have been using something like: public void SaveJPG(Image Image, string FileName, long QualityLevel_0_100, long ColorDepthLevel) { ImageCodecInfo ImageCodecInfoJPG =...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.