[Zope-dev] Re: RackImage

Michael R. Bernstein webmaven@lvcm.com
Fri, 13 Apr 2001 09:30:07 -0700


Itai Tavor wrote:
> 
> Thanks, Michael! Turns out I just had to make a few small changes in
> my product to get it to work, which I discovered looking at yours.
> 
> Don't know if anything in my product that it would be interesting to
> add to yours... it's aimed at storing photos for a product catalog,
> most of what it adds to Image is methods for creating a photo based
> on another photo, used for creating a thumbnail.

Sure, I'll take a look at it.

The approach I'm taking (ZPatterns all the way!) is to
generalize the creation and association of the RackImages
with an ArchiveImage ZClass (that holds meta data). I've got
things set up to the point that the ArchiveImages are
traversable into their Rackimages, and the ids are rewritten
appropriately.

So the ArchiveImage ZClass intsances are stored and accessed
like this: ArchiveImages/001

And the RackImages are stored like this:
ArchiveImages/Renderings/001_original <-notice the id!

But I can access the image data from the apropriate
RackImage like this: ArchiveImages/001/original

Next up is RackImage instantiation based on scaled image
data. I think examining your code may be helpful, but I
probably only need your main .py file.

The number and sizes of Renderings that Images have will be
configurable at the application level.

Cheers,

Michael Bernstein.