[Zope] - Yet another stupid question: image folders

Christopher G. Petrilli petrilli@amber.org
Tue, 8 Dec 1998 19:49:38 -0500


On Wed, Dec 09, 1998 at 12:35:34AM +0000, Jim Fulton wrote:
> "Christopher G. Petrilli" wrote:
> > 
> > [ I make some offers as to Image handling ]
> 
> I'm going to try to respond to the entire thread at once by simply stating
> my position on how this should work.  Here goes:
> 
> 1. Images, and perhaps all objects, should have a method named something
>    like absoluteURL, that returns some kind of absolute URL.
>
>    Franky, I'm not sure how this will work, but your comments have convinced
>    me that it should work. Note that it may only work in the context of a 
>    web request.  

That's the only time it's really useful.  I think as sites grow and
become more "media" intensive this will be a bigger and bigger deal.

>    Note that objects will not store their URL because an object
>    may be referenced from many places and therefore may have more 
>    than one URL.  The value returned from absoluteURL will likely
>    take into account the way the object was accessed.  (There will
>    likely be lots of magic involved; best not think too hard 
>    about it or keep the glue gun handy. ;)

It seems that this "absoluteURL" should actually normally print it's
normal location, regardless of how it was discovered via acquisition,
no?  Maybe there should be an option to print it's acquired location,
but ... otherwise all the caching in the world is never gonna help you.

> 2. The str for an image will use absoluteURL and will use size 
>    methods too, if there every are any.

I'm one who thinks that this should be stored in Properties (i.e. WIDTH
HEIGHT attirbutes) that are calculated when the object is inserted into
the database.  These should be over-ridable whenever necessary for
obnoxious things like "blank GIFs" that need to be stretched :-) I.e. I
should be able to do:

	<!--#var image fmt="width=10"-->

Or some gook that makes sense :-)  I've not delved into how the fmt
command works, but last I looked it looked kinda hardwired ;-) 

> 3. There may be lots of other image methods that could be used
>    with fmt, as in:
> 
>    <!--#var "images.logo" fmt="relative"-->

I can see the fun from here! :-)

Chris
-- 
| Christopher Petrilli
| petrilli@amber.org