On Fri, Apr 3, 2009 at 1:35 PM, Erika L. Walker <[email protected]>wrote:
>
> Casey - I downloaded and am using this and it works perfectly thank you!
>
> Question ... I need to crop images that I will have no idea on how big
> they.
>
Is my best course of action to first scale them down if they are over a
> certain width, then from that - crop from somewhere that would be about the
> center?
Well if you run getImageInfo() first, from that figure out if X is larger
than Y, you can can initially scale by one or other to desired width or
height, then crop what ever may be left over.
So if your pic area is 200 x 300 (vertical) and the photo submitted is
actually a horizontal image, you will scale to y and crop x.
Now for cropping, guess best way to handle that would be to ask your user.
If we need to crop your image should we start from this corner, that corner
center etc. But that requires additional math.
I just take the lazy way out and crop from top left
<cfset imgInfo =
imageCFC.crop('',#filePath##\#ImgName#','#filePath#\#ImgName#',0,0,615,357)
/>
Scaling images UP just sucks really bad but you again want to figure out if
the image is wider or taller than your requirement and figure out if you are
scaling by x or y first, then cropping excess.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f
Archive:
http://www.houseoffusion.com/groups/cf-community/message.cfm/messageid:293885
Subscription: http://www.houseoffusion.com/groups/cf-community/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.5