<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi there,<div><br></div><div>I have a couple of webapps in django designed to run on xserves. When I started the apps last year, I found and used the CoreGraphics bindings for python as described at&nbsp;<a href="http://developer.apple.com/graphicsimaging/pythonandquartz.html">http://developer.apple.com/graphicsimaging/pythonandquartz.html</a> and some other places. Actually, this was the reason I took up python in the first place (which was most certainly no mistake!).&nbsp;</div><div><br></div><div>But -- as the xserve runs Apache as Intel64, I had to recompile stuff for Apache. Not a problem. The CoreGraphics bindings are used as a standalone cli app within my webapp, so no problem with those either, as long as Apache doesn't want to run them.&nbsp;</div><div><br></div><div>A couple of things have changed in the last year, though. For starters, it seems the CoreGraphics bindings are going nowhere, PyObjC seems to be the way forward. A rather steep learning curve, but so be it. And then I have now found need for Apache to use CoreGraphics. I know I have alternatives (ReportLab for PDF's PIL for bitmaps) but my stance is that my platform of choice has perfectly good support for these formats, (and does blazingly fast conversions to boot!) so why go looking for others?&nbsp;</div><div><br></div><div>The problem is of course that I need to coax PyObjC to be run by 64 bit Apache. I read about the ability for PyObjC to run in 64-bit mode at&nbsp;<a href="http://pyobjc.sourceforge.net/documentation/pyobjc-core/news.html">http://pyobjc.sourceforge.net/documentation/pyobjc-core/news.html</a>. I don't know where to find out if my python is built with the required&nbsp;MACOSX_DEPLOYMENT_TARGET=10.5, but I would think so (as I'm running 10.5.8). (And you must realise I'm no hard-core programmer -- I learn as I go -- make heaps of mistakes doing so)</div><div><br></div><div>I did try a few tricks to get pyobjc to build as full fat binary (that is&nbsp;-arch ppc -arch i386 -arch ppc64 -arch x86_64) but so far no joy.&nbsp;</div><div><br></div><div>(Actually one of the results was quite discerning: an example "ld warning: in build/temp.macosx-10.5-i386-2.5/Modules/_sortandmap.o, missing required architecture ppc64 in file</div><div>ld warning: in build/temp.macosx-10.5-i386-2.5/Modules/_sortandmap.o, missing required architecture x86_64 in file")</div><div><br></div><div>And I'm wondering if this is at all necessary.&nbsp;Because -- why can Apache run PIL??? -- the .so files are also not full fat, but you can indeed do "import Image"</div><div><br></div><div><div>dekkers-2:~ geert$ file /Library/Python/2.5/site-packages/PIL/_imaging.so&nbsp;</div><div>/Library/Python/2.5/site-packages/PIL/_imaging.so: Mach-O universal binary with 2 architectures</div><div>/Library/Python/2.5/site-packages/PIL/_imaging.so (for architecture i386):<span class="Apple-tab-span" style="white-space:pre">        </span>Mach-O bundle i386</div><div>/Library/Python/2.5/site-packages/PIL/_imaging.so (for architecture ppc7400):<span class="Apple-tab-span" style="white-space:pre">        </span>Mach-O bundle ppc</div><div><br></div><div>But if you do "import _imaging", Apache gives you: "Could not import ccnet.views. Error was: dlopen(/Library/Python/2.5/site-packages/PIL/_imaging.so, 2): no suitable image found.  Did find:&nbsp;/Library/Python/2.5/site-packages/PIL/_imaging.so: no matching architecture in universal wrapper"</div><pre><font class="Apple-style-span" face="'Lucida Grande'"><span class="Apple-style-span" style="white-space: normal;"><br></span></font></pre><pre><font class="Apple-style-span" face="'Lucida Grande'"><span class="Apple-style-span" style="white-space: normal;">Does anyone have any experience using cocoa libs in a webapp like I want to do? &nbsp;I really would like to get this going. Tips, tricks &amp; Enlightment would be very welcome!</span></font></pre><pre><font class="Apple-style-span" face="'Lucida Grande'"><span class="Apple-style-span" style="white-space: normal;"><br></span></font></pre><pre><font class="Apple-style-span" face="'Lucida Grande'"><span class="Apple-style-span" style="white-space: normal;">Geert</span></font></pre><pre><font class="Apple-style-span" face="'Lucida Grande'"><span class="Apple-style-span" style="white-space: normal;"><br></span></font></pre><pre><font class="Apple-style-span" face="'Lucida Grande'"><span class="Apple-style-span" style="white-space: normal;"><br></span></font></pre><div><br></div></div></body></html>