21278 Posts in 5728 Topics by 2599 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 297 Views |
-
Accessing image attributes for scaled image

27 February 2012 at 7:37pm
I am working with a new module - Display Anything - to create an image gallery. It returns an array of images that can be used to create the gallery. I can work with the full sized images using their attributes: $URL $Height etc. I can also display resized images e.g. $PaddedImage(80, 80).
What I need to do, and cannot, is retrieve the attributes such as $URL and $Height from a resized image.
In other instances, I have just sub-classed Image to create my own functions. That doesn't seem to be an option here.
Any suggestions?
-
Re: Accessing image attributes for scaled image

1 March 2012 at 4:55pm
going from memory here, its going to be something like:
<% control MyImage %>
<% control PaddedImage(80 80) %>
<img src="$Link" height="$Height" alt="$Title" />
<% end_control %>
<% end_control %>I cant remember if PaddedImage has a space or comma between the parameters in the control block, but its something like this..
-Chris
-
Re: Accessing image attributes for scaled image

6 March 2012 at 7:56pm
Chris,
Thanks for that. Unfortunately PaddedImage doesn't return an object, just an img tag string. I have rejigged my code so i don't need to access the attributes. The alternative would be to use javascript to extract the information from the tag.
| 297 Views | ||
|
Page:
1
|
Go to Top |

