Tuesday, June 29, 2010

Getting PIL to work well on Snow Leopard

I was trying to update my environment and ran into some linker problems. It turns out that PIL was not working well. My Python is 64 bit, the python that my environment was trying to use was i386 and ppc. I have not been building ppc files. I found a few great references out there.
Universal Binaries on Mac Ports was the best. Modifying your varients.conf file to include:
+universal
Gets you half of the way. If you need ppc support under a 64 bit Intel setup, you need to add them manually into macports.conf:
# machine architectures
universal_archs x86_64 i386
Changes to:
# machine architectures
universal_archs x86_64 i386 ppc
Save these two files and then rebuild. In this case, I was rebuilding a PIL dependency jpeg. I also found out I had to add a few more dependencies for linking to be happy:
sudo port upgrade --force jpeg
sudo port install zlib
sudo port install freetype 
The "--force" made sure to stomp over the existing compile even though other things depended on it. As mentioned in the article referenced at the top, the way to nuke and rebuild everything is by running "sudo port upgrade --force installed". I do not recommend this unless you need to or have a lot of time on your hands. It will all be rebuilt. :)

Hope this helps someone. If it does, please let me know.

Jacob

Friday, June 25, 2010

Apple was Right, and Other Updates

It turns out that Apple's iPhone 4 advertising was right. I thought It Changes Everything. Again. was pure ostentatious marketing fluff. I was duped by the "higher resolution than the human retina" line for a little while. I figured this line was just pure easy proof that Apple had finally managed to jump the shark. At it turns out, it is the literal truth. They are trying to change the way people hold their phones. Yes. If you hold it in the wrong place, you loose everything. If you hold it in the right place, you are at the mercy of ATT. As they said in Sneakers, "Now you won't know who to trust." When your phone call is dropped, it must be your fault, because you were holding it. You know, your handheld device. It is so pretty, it should not be touched.

On a more positive note, as some of you may remember, my Kindle II used to be a little photo sensitive. For those who would like to see pictures of the issue: Blurry Kindle in the Sun. I am happy to report that after dropping my Kindle out of my hands and onto concrete, Amazon replaced it for free. YAY customer service! The new replacement does not have this issue. I can now change pages in the car or in the sun and the image is still clear. I have read elsewhere that the Amazon has been replacing Kindles for this issue alone. I really respect that and love it when a company stands behind their products.