Doug Brown wrote:
> Is there a CF tag out there that will take a image and reduce it's size 
> "properly"? Say someone uploads an image that is 100px High X 50px wide, and 
> I only want images that are say 50px high. Is there something that will 
> automatically make the image in question 50px high X 25px wide and keep the 
> right proportions, as to not distort the image?
> 
> Regards,
> 
> 
> Doug
> 

On any image manipulation tags I've seen, you have to calculate the
proper proportions in order to keep them.

Here's some example code when using BlueDragon's CFIMAGE tag:

<!--- Get the image info using the CFIMAGE tag --->
<CFIMAGE
        action="info"
srcfile="#variables.tmpServerDirectory#/#variables.PicName#.#variables.tmpServerFileExt#">
<!--- Set the desired width of the thumbnail to create --->
<CFSET variables.NewImageSize = "110">
<!--- Find out what percentage the size that we want the image to be is
to the size that the image already is --->
<CFSET variables.NewPercentage = Evaluate(variables.NewImageSize /
cfimage.width)>
<CFSET variables.NewPercentage = Round(variables.NewPercentage * 100)>
<!--- now create the thumbnail (in this case... just for GIF images) --->
<CFIMAGE
SRCFILE="#variables.tmpServerDirectory#/#variables.PicName#.#variables.tmpServerFileExt#"
DESTFILE="#variables.tmpServerDirectory#/#variables.PicName#_tn.#variables.tmpServerFileExt#"
                ACTION="edit"
                TYPE="gif"
                WIDTH="#variables.NewPercentage#%"
                HEIGHT="#variables.NewPercentage#%"
                URIDIRECTORY="NO">


Hope this helps!

-- 
Warm regards,
Jordan Michaels
Vivio Technologies
http://www.viviotech.net/
Blue Dragon Alliance Member
[EMAIL PROTECTED]

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four 
times a year.
http://www.fusionauthority.com/quarterly

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:259960
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to