On Sep 10, 7:11 pm, Jason Merrill [EMAIL PROTECTED] wrote:
Hi Jason,
I had been having trouble for a while figuring out how to load jpgs
into a usable form on OS X. The optional PIL spkg that gets installed
through sage -i PIL-1.1.5.spkg would throw an IOError when I tried to
load in a jpeg, complaining that the jpeg decoder wasn't available.
I found a work around tonight, which was to install PIL through
macports (py25-pil is the package name). I already had libjpeg
installed through macports (jpeg is the package name). Then I just
went into the directory where PIL got installed, /opt/local/lib/
python2.5/site-packages/, and then copied the PIL folder and PIL.pth
into sage's python: /Applications/sage/local/lib/python/site-packages/
Sage 3.1.2 will have the fixes so we no longer end up using Apple's
IOKit. This caused a bunch of issues with libpng.dylib similar to the
above. There is an spkg for libjpeg, but it is not merged yet. Once
that is merged the above problem will go away.
With that stuff there, I can now do
sage: import pylab
sage: imjpg = pylab.imread(DATA+'aarts02.jpg')
sage: pylab.imshow(imjpg)
sage: pylab.savefig('imjpg')
and I actually see an image.
If I can provide information or anything else helpful for turning this
hack into something that works the way sage is supposed to, please let
me know.
Regards,
JM
Cheers,
Michael
--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---