How to compress jpeg image programmatically in ColdFusion

CFImage - compress jpeg image programmatically

cfimageCompress.cfm


<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>cfimage action write: how to compress jpeg image programmatically in coldfusion</title>
</head>

<body>
<h2 style="color:Crimson; font-style:italic">cfimage tag example: how to compress jpeg image</h2>
<hr width="575" align="left" color="OrangeRed" />
<br />

<cfimage source="Images/Orchid1.jpg" action="write" destination="Images/Orchid1New.jpg" quality=".4" overwrite="yes" />


<table border="1" cellpadding="5" cellspacing="0" bordercolor="PapayaWhip">
    <tr bgcolor="Orange" style="color:Snow; font-size:large" align="center">
        <td>
            Image Preview
        </td>
        <td>
            after compress: quality .4
        </td>
    </tr>
    <tr height="100" valign="top">
        <td style="color:RosyBrown; font-weight:bold">
   <img src="Images/Orchid1.jpg" height="296" width="334"/>
        </td>
        <td>
   <img src="Images/Orchid1New.jpg"/>
        </td>
    </tr>
</table>

</body>
</html>





More ColdFusion examples