Mac OS X and jpeg support....

Jerry jerry.levan at eku.edu
Thu May 13 15:42:40 EDT 2004


Hi,
I am (today!) starting to Python...

I am runnin MacOS X 10.3.3 with:

  1) "Batteries included" Aqua Tcl/Tk version 8.4.5
  2)  The 2.3 version of Python that comes with the OS
  3) The "Panther Additions for MacOS X" package

I have used the package manager to install Tkinter. I ran a couple of
examples and Tkinter seems to work.

I tried installing via the package manage the PIL package and trying
to do anything with jpegs fails....I noticed that I did not have libjpeg
installed.  I got the jpg-6b package and created libjpeg.dylib in /usr/local/lib.

I tore out the PIL stuff from /Library and reinstalled the PIL package via
the package manager....I still get failures when trying to display a jpeg
file ( format not recognized...)

Here is a simple program I am trying to use...

#!/usr/bin/python

from Tkinter import *
import Image
import sys

def main():
    filename = sys.argv[1]
    root = Tk()
    img = PhotoImage(file=filename)
    label = Label(root, image=img)
    label.pack()
    root.mainloop()

main()

The program will do gifs ok...

How can I get jpeg support going?

Jerry



More information about the Python-list mailing list