[Zope] popen2 problem with Zope 2.7.0 and Photo

Ron Bickers rbickers-expires-1077579729.af1112 at logicetc.com
Mon Feb 16 18:42:07 EST 2004


On 02/16/2004 1:54 PM, Troy Farrell wrote:

>>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 :)

Create a Python Script with the attached content in your root folder and
call it through the Web.  It will 1) change the default engine to PIL for
all Photo Folders, 2) change the engine of all Photo objects to PIL, and 3)
purge all the cached displays created by ImageMagick.

It has been a while since I've used this.  Let me know if you have any
problems with it.

-- 
Ron Bickers
Logic Etc, Inc.
-------------- next part --------------
"""Regenerate ImageMagick images using PIL."""

print 'The following objects were upgraded:<br>\n'

# Change default engine of all Photo Folders to PIL.
folders = context.ZopeFind(context, obj_metatypes=['Photo Folder'], search_sub=1)
for (id, folder) in folders:
   if folder.propertysheets.get('photoconf').getProperty('engine') == 'ImageMagick':
       folder.propertysheets.get('photoconf').manage_changeProperties(engine='PIL')
       print 'Photo Folder <tt>' + '/'.join(folder.getPhysicalPath()) + \
            '</tt><br>\n'
photos = context.ZopeFind(context, obj_metatypes=['Photo'], search_sub=1)

# Change engine of all Photos to PIL and purge displays.
for (id, photo) in photos:
   if photo.propertysheets.get('photoconf').getProperty('engine') == 'ImageMagick':
       print 'Purging %s<br>\n' % id
       photo.propertysheets.get('photoconf').manage_changeProperties(engine='PIL')
       photo.manage_purgeDisplays()
       print 'Photo <tt>' + '/'.join(photo.getPhysicalPath()) + \
            '</tt><br>\n'
return printed


More information about the Zope mailing list