Mac OS X and jpeg support....

J

Jerry

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
 
C

Christopher Barker

Jerry said:
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...)
How can I get jpeg support going?

There is another Package Manger Repository put together by Bob Ippolito,
and I think it includes a PIL with jpeg support built in. Check out the
archives of the Python-Mac mailing list. You should be abel to find it
at www.python.org. If you don't find what you need in the archives, join
the mailing list and post a question there.

-Chris


--
Christopher Barker, Ph.D.
Oceanographer

NOAA/OR&R/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

(e-mail address removed)
 
R

Roberto Lopez-Gulliver

There is another Package Manger Repository put together by Bob Ippolito,
and I think it includes a PIL with jpeg support built in. Check out the
archives of the Python-Mac mailing list. You should be abel to find it
at www.python.org.

I got my python running on MacOS X following the instructions in the
VisionEgg project (which in turns points you Bob Ippolito's
repository)

http://www.visionegg.org/install-macosx-details.html
http://undefined.org/python/pimp/darwin-7.2.0-Power_Macintosh.plist

hope this helps ... and have fun!

--r
 

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
474,197
Messages
2,571,040
Members
47,635
Latest member
SkyePurves

Latest Threads

Top