<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: libjpeg and Python Imaging (PIL) on Snow Leopard</title>
	<atom:link href="http://jetfar.com/libjpeg-and-python-imaging-pil-on-snow-leopard/feed/" rel="self" type="application/rss+xml" />
	<link>http://jetfar.com/libjpeg-and-python-imaging-pil-on-snow-leopard/</link>
	<description>Rich Atkinson&#039;s Personal Blog</description>
	<lastBuildDate>Sat, 19 Dec 2009 16:48:17 +1100</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: mike</title>
		<link>http://jetfar.com/libjpeg-and-python-imaging-pil-on-snow-leopard/comment-page-1/#comment-432</link>
		<dc:creator>mike</dc:creator>
		<pubDate>Tue, 03 Nov 2009 20:19:07 +0000</pubDate>
		<guid isPermaLink="false">http://jetfar.com/?p=234#comment-432</guid>
		<description>I’ve heard there are some wildlife groups trying to get Apple to do more stuff with the actual S.L.’s lol. I don’t know- people are saying it’s good PR for Apple- they should jump on that.</description>
		<content:encoded><![CDATA[<p>I’ve heard there are some wildlife groups trying to get Apple to do more stuff with the actual S.L.’s lol. I don’t know- people are saying it’s good PR for Apple- they should jump on that.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Luke</title>
		<link>http://jetfar.com/libjpeg-and-python-imaging-pil-on-snow-leopard/comment-page-1/#comment-429</link>
		<dc:creator>Luke</dc:creator>
		<pubDate>Thu, 29 Oct 2009 21:44:54 +0000</pubDate>
		<guid isPermaLink="false">http://jetfar.com/?p=234#comment-429</guid>
		<description>I solved this issue (for me, anyway) today.

- Make sure that you are NOT using GCC 4.0. That means those export lines in your .bash_profile file that you needed to get MySQLdb working now need to go away.
- I used libjpeg 7 (http://www.ijg.org/files/jpegsrc.v7.tar.gz), even though I doubt it was necessary.
- Before installing PIL but after installing libjpeg, I changed the &quot;JPEG_ROOT = None&quot; line in my setup.py file to &quot;JPEG_ROOT = libinclude(&quot;/usr/local&quot;)&quot;</description>
		<content:encoded><![CDATA[<p>I solved this issue (for me, anyway) today.</p>
<p>- Make sure that you are NOT using GCC 4.0. That means those export lines in your .bash_profile file that you needed to get MySQLdb working now need to go away.<br />
- I used libjpeg 7 (<a href="http://www.ijg.org/files/jpegsrc.v7.tar.gz)">http://www.ijg.org/files/jpegsrc.v7.tar.gz)</a>, even though I doubt it was necessary.<br />
- Before installing PIL but after installing libjpeg, I changed the &#8220;JPEG_ROOT = None&#8221; line in my setup.py file to &#8220;JPEG_ROOT = libinclude(&#8221;/usr/local&#8221;)&#8221;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Luke</title>
		<link>http://jetfar.com/libjpeg-and-python-imaging-pil-on-snow-leopard/comment-page-1/#comment-428</link>
		<dc:creator>Luke</dc:creator>
		<pubDate>Thu, 29 Oct 2009 21:10:03 +0000</pubDate>
		<guid isPermaLink="false">http://jetfar.com/?p=234#comment-428</guid>
		<description>I&#039;m stuck with the same issue being described by most others immediately above me.

Has anyone found a solution? (I will post if I figure it out...)</description>
		<content:encoded><![CDATA[<p>I&#8217;m stuck with the same issue being described by most others immediately above me.</p>
<p>Has anyone found a solution? (I will post if I figure it out&#8230;)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Giacecco</title>
		<link>http://jetfar.com/libjpeg-and-python-imaging-pil-on-snow-leopard/comment-page-1/#comment-427</link>
		<dc:creator>Giacecco</dc:creator>
		<pubDate>Thu, 29 Oct 2009 20:31:41 +0000</pubDate>
		<guid isPermaLink="false">http://jetfar.com/?p=234#comment-427</guid>
		<description>Remi: if you are still reading this, I am trying following your instructions because they are slightly different than everything I have tried so far, but I&#039;ve bumped in an error already when making jpeg-7. The output I get is http://drop.io/npalbw9 . Did you have this, too? It does not really look like I can do a make install after this!</description>
		<content:encoded><![CDATA[<p>Remi: if you are still reading this, I am trying following your instructions because they are slightly different than everything I have tried so far, but I&#8217;ve bumped in an error already when making jpeg-7. The output I get is <a href="http://drop.io/npalbw9">http://drop.io/npalbw9</a> . Did you have this, too? It does not really look like I can do a make install after this!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Giacecco</title>
		<link>http://jetfar.com/libjpeg-and-python-imaging-pil-on-snow-leopard/comment-page-1/#comment-425</link>
		<dc:creator>Giacecco</dc:creator>
		<pubDate>Thu, 29 Oct 2009 07:14:32 +0000</pubDate>
		<guid isPermaLink="false">http://jetfar.com/?p=234#comment-425</guid>
		<description>In case it was interesting, I have solved the “-Wno-long-double” problem and now I am back together with everyone else at the _jpeg_resync_to_restart error!

I also tried the otool trick, but it shows no dependency at all on libjpeg! During PIL compilation, the output correctly says that Jpeg support is present.</description>
		<content:encoded><![CDATA[<p>In case it was interesting, I have solved the “-Wno-long-double” problem and now I am back together with everyone else at the _jpeg_resync_to_restart error!</p>
<p>I also tried the otool trick, but it shows no dependency at all on libjpeg! During PIL compilation, the output correctly says that Jpeg support is present.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jesse</title>
		<link>http://jetfar.com/libjpeg-and-python-imaging-pil-on-snow-leopard/comment-page-1/#comment-424</link>
		<dc:creator>jesse</dc:creator>
		<pubDate>Wed, 28 Oct 2009 14:43:52 +0000</pubDate>
		<guid isPermaLink="false">http://jetfar.com/?p=234#comment-424</guid>
		<description>I&#039;ve been banging my head against the wall with this problem for a few days, but I finally got it worked out.

First of all, my system is running python in 32bit mode with the same configuration as Stefan&#039;s shown above.

The key to fixing this was noticing that the libraries in /opt/local were always getting included and taking precedence over any other libjpeg libraries in the system (same with zlib). First I uninstalled all libjpeg related ports, and then installed libjpeg from here: http://www.ijg.org/files/jpegsrc.v7.tar.gz

The output from rebuilding PIL showed &quot;ok&quot; for support of all the functionality, but when I imported _imaging I got an error. But it was a new error! Symbol not found: _deflate.

After discovering that it related to zlib, I uninstalled zlib from ports and freetype. I got zlib-1.2.3, which installed fine from source. Then I tried the newest version of freetype, but it wouldn&#039;t build. The readme from PIL suggests freetype &gt;= 2.1.3, so I chose 2.1.10. It built and installed fine from source.

With all my libraries now in /usr/local, I rebuilt PIL (using libconfig(&quot;/usr/local&quot;) for jpeg, freetype and zlib), and everything went fine. Installed PIL, fired up python interpreter and imported _imaging, and no error!!!</description>
		<content:encoded><![CDATA[<p>I&#8217;ve been banging my head against the wall with this problem for a few days, but I finally got it worked out.</p>
<p>First of all, my system is running python in 32bit mode with the same configuration as Stefan&#8217;s shown above.</p>
<p>The key to fixing this was noticing that the libraries in /opt/local were always getting included and taking precedence over any other libjpeg libraries in the system (same with zlib). First I uninstalled all libjpeg related ports, and then installed libjpeg from here: <a href="http://www.ijg.org/files/jpegsrc.v7.tar.gz">http://www.ijg.org/files/jpegsrc.v7.tar.gz</a></p>
<p>The output from rebuilding PIL showed &#8220;ok&#8221; for support of all the functionality, but when I imported _imaging I got an error. But it was a new error! Symbol not found: _deflate.</p>
<p>After discovering that it related to zlib, I uninstalled zlib from ports and freetype. I got zlib-1.2.3, which installed fine from source. Then I tried the newest version of freetype, but it wouldn&#8217;t build. The readme from PIL suggests freetype &gt;= 2.1.3, so I chose 2.1.10. It built and installed fine from source.</p>
<p>With all my libraries now in /usr/local, I rebuilt PIL (using libconfig(&#8221;/usr/local&#8221;) for jpeg, freetype and zlib), and everything went fine. Installed PIL, fired up python interpreter and imported _imaging, and no error!!!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Giacecco</title>
		<link>http://jetfar.com/libjpeg-and-python-imaging-pil-on-snow-leopard/comment-page-1/#comment-420</link>
		<dc:creator>Giacecco</dc:creator>
		<pubDate>Sun, 25 Oct 2009 12:10:34 +0000</pubDate>
		<guid isPermaLink="false">http://jetfar.com/?p=234#comment-420</guid>
		<description>Thank you so much for publishing your solution to this. 

I tried doing the same myself but it did not work for me... actually I got into more trouble than the one I started from! 

Now building PIL creates MacOS 10.3 binaries

$ sudo python2.5 setup.py build
running build
running build_py
creating build/lib.macosx-10.3-i386-2.5
copying PIL/__init__.py -&gt; build/lib.macosx-10.3-i386-2.5
copying PIL/ArgImagePlugin.py -&gt; build/lib.macosx-10.3-i386-2.5
copying PIL/BdfFontFile.py -&gt; build/lib.macosx-10.3-i386-2.5
(...)

and then fails with:

cc1: error: unrecognized command line option &quot;-Wno-long-double&quot;

I believe there may be confusion between Snow Leopard&#039;s own Python and the one I installed from http://www.python.org . I could not use the default one because I need my code to work on 2.5 . Any advice?</description>
		<content:encoded><![CDATA[<p>Thank you so much for publishing your solution to this. </p>
<p>I tried doing the same myself but it did not work for me&#8230; actually I got into more trouble than the one I started from! </p>
<p>Now building PIL creates MacOS 10.3 binaries</p>
<p>$ sudo python2.5 setup.py build<br />
running build<br />
running build_py<br />
creating build/lib.macosx-10.3-i386-2.5<br />
copying PIL/__init__.py -&gt; build/lib.macosx-10.3-i386-2.5<br />
copying PIL/ArgImagePlugin.py -&gt; build/lib.macosx-10.3-i386-2.5<br />
copying PIL/BdfFontFile.py -&gt; build/lib.macosx-10.3-i386-2.5<br />
(&#8230;)</p>
<p>and then fails with:</p>
<p>cc1: error: unrecognized command line option &#8220;-Wno-long-double&#8221;</p>
<p>I believe there may be confusion between Snow Leopard&#8217;s own Python and the one I installed from <a href="http://www.python.org">http://www.python.org</a> . I could not use the default one because I need my code to work on 2.5 . Any advice?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Norman</title>
		<link>http://jetfar.com/libjpeg-and-python-imaging-pil-on-snow-leopard/comment-page-1/#comment-419</link>
		<dc:creator>Norman</dc:creator>
		<pubDate>Sun, 25 Oct 2009 06:06:49 +0000</pubDate>
		<guid isPermaLink="false">http://jetfar.com/?p=234#comment-419</guid>
		<description>I am not very savvy UNIX user so I tried the steps as described . When I try to install I get this:

SockMonkey:jpeg-6b norman$ sudo make install
Password:
/usr/bin/install -c -m 644 jconfig.h /usr/local/include/jconfig.h
/usr/bin/install -c -m 644 ./jpeglib.h /usr/local/include/jpeglib.h
/usr/bin/install -c -m 644 ./jmorecfg.h /usr/local/include/jmorecfg.h
/usr/bin/install -c -m 644 ./jerror.h /usr/local/include/jerror.h
./libtool --mode=install /usr/bin/install -c libjpeg.la /usr/local/lib/libjpeg.la
/usr/bin/install -c libjpeg.la /usr/local/lib/libjpeg.la
/usr/bin/install -c .libs/libjpeg.a /usr/local/lib/libjpeg.a
ranlib /usr/local/lib/libjpeg.a
chmod 644 /usr/local/lib/libjpeg.a
------------------------------------------------------------------------------
Libraries have been installed in:
   /usr/local/lib

To link against installed libraries in a given directory, LIBDIR,
you must use the `-LLIBDIR&#039; flag during linking.

 You will also need to do one of the following:

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
------------------------------------------------------------------------------
./libtool --mode=install /usr/bin/install -c cjpeg /usr/local/bin/cjpeg
/usr/bin/install -c cjpeg /usr/local/bin/cjpeg
install: /usr/local/bin/cjpeg: No such file or directory
make: *** [install] Error 71
SockMonkey:jpeg-6b norman$ 
*******************************************


I appreciate any help.</description>
		<content:encoded><![CDATA[<p>I am not very savvy UNIX user so I tried the steps as described . When I try to install I get this:</p>
<p>SockMonkey:jpeg-6b norman$ sudo make install<br />
Password:<br />
/usr/bin/install -c -m 644 jconfig.h /usr/local/include/jconfig.h<br />
/usr/bin/install -c -m 644 ./jpeglib.h /usr/local/include/jpeglib.h<br />
/usr/bin/install -c -m 644 ./jmorecfg.h /usr/local/include/jmorecfg.h<br />
/usr/bin/install -c -m 644 ./jerror.h /usr/local/include/jerror.h<br />
./libtool &#8211;mode=install /usr/bin/install -c libjpeg.la /usr/local/lib/libjpeg.la<br />
/usr/bin/install -c libjpeg.la /usr/local/lib/libjpeg.la<br />
/usr/bin/install -c .libs/libjpeg.a /usr/local/lib/libjpeg.a<br />
ranlib /usr/local/lib/libjpeg.a<br />
chmod 644 /usr/local/lib/libjpeg.a<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
Libraries have been installed in:<br />
   /usr/local/lib</p>
<p>To link against installed libraries in a given directory, LIBDIR,<br />
you must use the `-LLIBDIR&#8217; flag during linking.</p>
<p> You will also need to do one of the following:</p>
<p>See any operating system documentation about shared libraries for<br />
more information, such as the ld(1) and ld.so(8) manual pages.<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
./libtool &#8211;mode=install /usr/bin/install -c cjpeg /usr/local/bin/cjpeg<br />
/usr/bin/install -c cjpeg /usr/local/bin/cjpeg<br />
install: /usr/local/bin/cjpeg: No such file or directory<br />
make: *** [install] Error 71<br />
SockMonkey:jpeg-6b norman$<br />
*******************************************</p>
<p>I appreciate any help.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Remi</title>
		<link>http://jetfar.com/libjpeg-and-python-imaging-pil-on-snow-leopard/comment-page-1/#comment-387</link>
		<dc:creator>Remi</dc:creator>
		<pubDate>Mon, 19 Oct 2009 22:46:49 +0000</pubDate>
		<guid isPermaLink="false">http://jetfar.com/?p=234#comment-387</guid>
		<description>Well, a small problem I solved before the big libjpeg problem :

I could&#039;nt manage to compile PIL (Imaging) with the last version of gcc (4.2). So I forced the compilation with gcc 4.0 by modifying the alias in /usr/bin

WARNING: This has only been tested on my macbook pro running Snow Leopard. Please only follow this if you fully understand what it does.

Forcing gcc to use 4.0 version :
sudo rm /usr/bin/gcc
sudo ln -s /usr/bin/gcc-4.0 /usr/bin/gcc

Getting back to the 4.2 version of gcc :
sudo rm /usr/bin/gcc
sudo ln -s /usr/bin/gcc-4.2 /usr/bin/gcc</description>
		<content:encoded><![CDATA[<p>Well, a small problem I solved before the big libjpeg problem :</p>
<p>I could&#8217;nt manage to compile PIL (Imaging) with the last version of gcc (4.2). So I forced the compilation with gcc 4.0 by modifying the alias in /usr/bin</p>
<p>WARNING: This has only been tested on my macbook pro running Snow Leopard. Please only follow this if you fully understand what it does.</p>
<p>Forcing gcc to use 4.0 version :<br />
sudo rm /usr/bin/gcc<br />
sudo ln -s /usr/bin/gcc-4.0 /usr/bin/gcc</p>
<p>Getting back to the 4.2 version of gcc :<br />
sudo rm /usr/bin/gcc<br />
sudo ln -s /usr/bin/gcc-4.2 /usr/bin/gcc</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Remi</title>
		<link>http://jetfar.com/libjpeg-and-python-imaging-pil-on-snow-leopard/comment-page-1/#comment-386</link>
		<dc:creator>Remi</dc:creator>
		<pubDate>Mon, 19 Oct 2009 22:39:44 +0000</pubDate>
		<guid isPermaLink="false">http://jetfar.com/?p=234#comment-386</guid>
		<description>I just solved my own version of the _jpeg_resync_to_restart error by installing the libjpeg v7 specifying the i386 architecture.

I found, running one of the gcc command from the Imaging installation, that it made the following error : &quot;libjpeg.a, file is not of required architecture&quot;. So I googled a bit about that problem and found out that I should install the last version of libjpeg forcing the architecture.

That&#039;s what I did :
1) After detaring the jpegsrc.v7.tar.gz file and running ./configure, I edited &quot;Makefile&quot; and found the line :
LDFLAGS =
and replaced it by :
LDFLAGS = -arch i386 ...
Then make and make install. 

2) The lib was installed in /usr/local/lib so, back to the PIL installation : I detared &quot;Imaging-1.1.6.tar.gz&quot;, went into the new directory and edited &quot;setup.py&quot;. I replaced
JPEG_ROOT = None
by
JPEG_ROOT = &quot;/usr/local/lib&quot; 

3) Then I ran the &quot;python setup.py build&quot; and &quot;python setup.py install&quot; commands and it was working !

Good luck !</description>
		<content:encoded><![CDATA[<p>I just solved my own version of the _jpeg_resync_to_restart error by installing the libjpeg v7 specifying the i386 architecture.</p>
<p>I found, running one of the gcc command from the Imaging installation, that it made the following error : &#8220;libjpeg.a, file is not of required architecture&#8221;. So I googled a bit about that problem and found out that I should install the last version of libjpeg forcing the architecture.</p>
<p>That&#8217;s what I did :<br />
1) After detaring the jpegsrc.v7.tar.gz file and running ./configure, I edited &#8220;Makefile&#8221; and found the line :<br />
LDFLAGS =<br />
and replaced it by :<br />
LDFLAGS = -arch i386 &#8230;<br />
Then make and make install. </p>
<p>2) The lib was installed in /usr/local/lib so, back to the PIL installation : I detared &#8220;Imaging-1.1.6.tar.gz&#8221;, went into the new directory and edited &#8220;setup.py&#8221;. I replaced<br />
JPEG_ROOT = None<br />
by<br />
JPEG_ROOT = &#8220;/usr/local/lib&#8221; </p>
<p>3) Then I ran the &#8220;python setup.py build&#8221; and &#8220;python setup.py install&#8221; commands and it was working !</p>
<p>Good luck !</p>
]]></content:encoded>
	</item>
</channel>
</rss>
