PIL question - saving JPEG

Discussion in 'Python' started by news.west.cox.net, Oct 10, 2004.

  1. 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.
     
    news.west.cox.net, Oct 10, 2004
    #1
    1. Advertising

  2. "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-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>
     
    Fredrik Lundh, Oct 10, 2004
    #2
    1. Advertising

  3. "Fredrik Lundh" <> wrote in message
    news:...
    > "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-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.
     
    news.west.cox.net, Oct 11, 2004
    #3
  4. 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" <> 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.
    >
    >
    >
     
    news.west.cox.net, Oct 13, 2004
    #4
  5. On Tue, 12 Oct 2004 17:40:36 -0700
    "news.west.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
     
    Josiah Carlson, Oct 13, 2004
    #5
  6. On Sun, 10 Oct 2004 14:00:40 -0700, rumours say that "news.west.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
     
    Christos TZOTZIOY Georgiou, Oct 14, 2004
    #6
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Eugene Morozov

    JPEG comments and PIL

    Eugene Morozov, Sep 11, 2003, in forum: Python
    Replies:
    1
    Views:
    379
    Fredrik Lundh
    Sep 13, 2003
  2. Gerrit Holl

    PIL: jpeg comment

    Gerrit Holl, Dec 23, 2003, in forum: Python
    Replies:
    1
    Views:
    371
    John P. Speno
    Dec 29, 2003
  3. Jeff Kunce

    RE: [Image-SIG] PIL: jpeg comment

    Jeff Kunce, Jan 2, 2004, in forum: Python
    Replies:
    0
    Views:
    442
    Jeff Kunce
    Jan 2, 2004
  4. lovaspillando
    Replies:
    0
    Views:
    1,037
    lovaspillando
    Aug 26, 2007
  5. Ivan Alameda Carballo
    Replies:
    0
    Views:
    497
    Ivan Alameda Carballo
    Aug 26, 2007
Loading...

Share This Page