[Zope] How to convert an Image to an Photo programmatically ?

Ron Bickers rbickers-dated-1017328138.23aa81@logicetc.com
Thu, 21 Mar 2002 10:09:00 -0500


> -----Original Message-----
> From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of
> Joachim Schmitz

> I have a bunch of images in the ZODB, which I want to convert to
> Photos in
> the Photo product.

> Error Type: AttributeError
> Error Value: read

There is a problem with Photo 1.2.3 that breaks what you're doing.  Apply
the following changes to fix it:

In Photo.py, manage_addPhoto(), replace the following line:

    photo._data = file.read()

with this:

    try:
        photo._data = file.read()
    except AttributeError:
        photo._data = file

_______________________

Ron Bickers
Logic Etc, Inc.