To reduce the size of large files, you can convert a JPEG file to a lower quality image by using the write action of the cfimage tag. Specify a value between 0 (low) and 1 (high) for the quality attribute, as the following example shows:

<cfimage source="../cfdocs/images/artgallery/jeff05.jpg" action="write"
destination="jeff05_lq.jpg" quality="0.5" overwrite="yes">

You can perform the same operation by using the ImageWrite function:

<cfset myImage=ImageNew("jeff05.jpg")>
<cfset ImageWrite(myImage,"jeff05_lq.jpg","0.5")>

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License  Twitter™ and Facebook posts are not covered under the terms of Creative Commons.

Legal Notices   |   Online Privacy Policy