I've been trying to programmatically resize and crop images with ColdFusion 10. What's driving me nuts is that I can not make it equally crop images from bottom and top while maintaining the same width in the process.
Here is what I currently have, just a few simple lines:
<cfimage source="images/test/airateapple.png" name="myImage" overwrite="yes">
<cfif ImageGetWidth(myImage) gte 1024>
<cfset ImageSetAntialiasing(myImage,"on")>
<cfset ImageScaleToFit(myImage,800,"","mediumquality")>
<cfif ImageGetHeight(myImage) gt 350>
<cfset sizeToCrop= ImageGetHeight(myImage) - 350>
<cfset ImageCrop(myImage,0, sizeToCrop
, ImageGetWidth(myImage)
, ImageGetHeight(myImage) )>
</cfif>
<cfset finalImage=myImage>
</cfif>
<!--- Display the modified image in a browser. --->
<cfimage source="#finalImage#" action="writeToBrowser">
For example, if image height is 500px after resizing is done, it should crop an additional 150px. More specifically, crop 75px from bottom and 75px from the top. Is it possible?