CFX_IMAGECR

How do I use CFX_ImageCR?

The following article explains how to use CFX_ImageCR. CFX_ImageCR is a ColdFusion tag we have installed on our systems that performs various operations on an image file, such as renaming, resizing and cropping. The tag loads the original image and then creates a new image with requested changes.

The following are a few examples of using CFX_ImageCR:

To rename an image file:

<cfx_imagecr3 load="#expandpath('example.jpg')#"
 save="#expandpath('example-resaved.jpg')#">

To resize an image file and display the new image:

<cfx_imagecr3 load="#expandpath('example.jpg')#"
 save="#expandpath('example-resized.jpg')#"
 resize="200x200">
<cfoutput>
 <img src="example-resized.jpg">
</cfoutput>

To crop an image file and display the new image:

<cfx_imagecr3 load="#expandpath('example.jpg')#"
 save="#expandpath('example-cropped.jpg')#"
 crop="200x200"
 anchor="center">
<cfoutput>
 <img src="example-cropped.jpg">
</cfoutput>

To gather and display information about the image file:

<cfx_imagecr3 getimageinfo="#expandpath('example.jpg')#" >
<cfoutput>
 <pre>
  Width = #imagecr.width#
  Height = #imagecr.height#
  DPI = #imagecr.dpi#
  FileSize = #imagecr.filesize#
 </pre>
</cfoutput>

More detailed information about this tag can be found here. This page contains a list of attributes, with examples, that are available with CFX_ImageCR.

 

© 2015 HostMySite