Created
August 3, 2012 13:38
Using The Quality Attribute With The CFImage WriteToBrowser Action
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!--- Convert PNG to JPG on the fly and write IMG tag to browser. ---> | |
<cfimage | |
action="writeToBrowser" | |
source="#pngFilePath#" | |
format="jpg" | |
/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!--- Read in our PNG image. ---> | |
<cfset png = imageNew( "./pull.png" ) /> | |
<!--- Write out as a JPG (default settings). ---> | |
<cfimage | |
action="writeToBrowser" | |
source="#png#" | |
format="jpg" | |
/> | |
<br /> | |
<br /> | |
<!--- Write out as a JPG at 100% (using "quality" attribute). ---> | |
<cfimage | |
action="writeToBrowser" | |
source="#png#" | |
format="jpg" | |
quality="1" | |
/> | |
<br /> | |
<br /> | |
<!--- Write out as a JPG at 20% (using "quality" attribute). ---> | |
<cfimage | |
action="writeToBrowser" | |
source="#png#" | |
format="jpg" | |
quality=".2" | |
/> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment