conditional resizing of an url-referenced image object

Nicolas Cueto niconiko at gmail.com
Thu May 13 01:25:25 EDT 2010


Hello,

On the one hand, I have a series of png images on my web-server. The
width of each varies quite somewhat, but the height is always 163.

On the other, there's a stack card on which is an image object with
its lockLoc set to true. Say, width 260 and height 163.

A script will set the filename of that image object to the url of one
of those web-server pngs.

Obviously, because of lockLoc, the web-image may get resized locally.
Which looks ok with most of my web-images. But not if the web-image is
"significantly" less wide than the image object's width of 163.

So, by way of solution I'm thinking that, before the fileName of the
image object gets set, the script could get the width of the web-image
and, if it's "significantly" less than 163, the script will set to
false the lockLoc. That way, the web-image gets displayed locally at
its actual size.

But, I don't know how to use Rev to get the width (or height) of an
image that is on my web-server.

If anyone knows, or if there's an alternate/better solution than what
I've thought up, I'd appreciate the help.

Thanks.

--
Nicolas Cueto



More information about the use-livecode mailing list