[Zope] popen2 problem with Zope 2.7.0 and Photo

Troy Farrell troy at entheossoft.com
Mon Feb 16 13:54:02 EST 2004


> What exactly are you trying to do when it hangs?  So far everything I've
> tried works.  I'm running Fedora Core 1, Python 2.3.3, Zope 2.7.0,
> ImageMagick 5.5.6.

Interesting.  I just accessing my 'view' page template.  Eventually, the
_resize method gets called and that's where the popen2 hangup happens. 
It's even more wierd that the same popen2 call doing the same thing works
fine outside of Zope (i.e. interactive python prompt.)

$ uname -a
Linux bosco 2.4.20-gentoo-r5 #4 SMP Thu Oct 16 15:29:56 CDT 2003 i686
Intel(R) Xeon(TM) CPU 2.00GHz GenuineIntel GNU/Linux
$ python
Python 2.3.3 (#1, Feb  5 2004, 13:04:26)
[GCC 3.2.3 20030422 (Gentoo Linux 1.4 3.2.3-r3, propolice)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>

I'm wondering if my system is over optimized (-O3)...

>> Any hints?
>
> The "best" thing to do, IMO, would be to install PIL 1.1.3 or higher and
> use
> it instead of ImageMagick.  As of 1.1.3, PIL has much better resize
> rendering which is as good as ImageMagick.  Since PIL is a Python module,
> you won't have any piping issues.  It's also faster at rendering.
>
> For it to render nicely, you'll need to change the following line (around
> 354) in Photo.py:
>
> from:   img = img.resize((width, height))
>   to:   img = img.resize((width, height), PIL.Image.ANTIALIAS)
>
> I have a little Python Script I used to convert my entire Photo collection
> from ImageMagick to PIL.  I'll be happy to share if you want to go this
> route.

Please do share the script.  I'm building PIL now :)

Troy



More information about the Zope mailing list