theRatio = 1;//set default

//check if the image width is gt than the height
if ( thisImage.width GTE thisImage.height ) {
        //find the ratio for resizing the new image
        theRatio = val(thisImage.height) / val(thisImage.width);
}

In this case the ratio based on the screen shot is 1052/1660 and
theRatio is 0.63373494
The new image width is the val(maxSize) or  600 in this cast
The new image heigh is val(maxSize) * theRatio) or rounded to 380

The code is not done, so if the height is gt than the width, then that
will be addressed. I'm just trying to get this basic code to work.

Stan

On Sun, Dec 5, 2010 at 1:44 AM, Alan Williamson <[email protected]> wrote:
> What's the value of 'theRatio' ?
> --
>  http://alan.blog-city.com/
>
> -----Original Message-----
> From: Stan Winchester <[email protected]>
> Sender: [email protected]
> Date: Sat, 4 Dec 2010 17:09:28
> To: <[email protected]>
> Reply-To: [email protected]
> Subject: Re: [OpenBD] ImageCopy() errors
>
> Alan,
>
> Thanks, I got 1.5 running, and the name parameter now works for
> ImageCopy(). I am having trouble getting the image to resize. Below is
> the code used, and attached is a dump of the results. According to the
> dump I would think the image should now be 600X360, but it is still
> 1660X1052. What am I doing wrong?
>
> imageParams.name = thisImage;
> imageParams.x = 0;
> imageParams.y = 0;
> imageParams.width = val(maxSize);
> imageParams.height = (val(maxSize) * theRatio);
> newImage = ImageCopy(ArgumentCollection=imageParams);
>

-- 
Open BlueDragon Public Mailing List
 http://www.openbluedragon.org/   http://twitter.com/OpenBlueDragon
 official manual: http://www.openbluedragon.org/manual/
 Ready2Run CFML http://www.openbluedragon.org/openbdjam/

 mailing list - http://groups.google.com/group/openbd?hl=en

Reply via email to