Re: [Zope] - Yet another stupid question: image folders
"Christopher G. Petrilli" wrote:
So I was sitting and breaking things last night (between the shower thoughts on FTp access, etc), and tried what seemed obvious to me, which is probably totally wrong given my inexperience with BoboPOS, but...
What I want to be able to do is have a folder that contains images as a subfolder to my current folder. Now I know I can reference them, no problem: <!--#var "images.logo"--> but that doesn't give the right SRC= line in the IMG directive. Now I sat and thought about this, but I'm just not sure how an image is supposed to find itself in the hierarchy so it can publish the right URL to find itself.
A simple solution would be for it to find itself and publish an absolute location, rather than relative (as it currently does), but that means it has to know wher eti is...
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. 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. ;) 2. The str for an image will use absoluteURL and will use size methods too, if there every are any. 3. There may be lots of other image methods that could be used with fmt, as in: <!--#var "images.logo" fmt="relative"--> Jim -- Jim Fulton mailto:jim@digicool.com Technical Director (540) 371-6909 Python Powered! Digital Creations http://www.digicool.com http://www.python.org Under US Code Title 47, Sec.227(b)(1)(C), Sec.227(a)(2)(B) This email address may not be added to any commercial mail list with out my permission. Violation of my privacy with advertising or SPAM will result in a suit for a MINIMUM of $500 damages/incident, $1500 for repeats.
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
"Christopher G. Petrilli" wrote:
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?
Yes, that's what I meant.
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.
Yes, but accessed via methods. -- Jim Fulton mailto:jim@digicool.com Technical Director (540) 371-6909 Python Powered! Digital Creations http://www.digicool.com http://www.python.org Under US Code Title 47, Sec.227(b)(1)(C), Sec.227(a)(2)(B) This email address may not be added to any commercial mail list with out my permission. Violation of my privacy with advertising or SPAM will result in a suit for a MINIMUM of $500 damages/incident, $1500 for repeats.
participants (2)
-
Christopher G. Petrilli -
Jim Fulton