Right, so ImageMagick installs a couple of helpful tools. One you will also use, that is the "convert" and the other is the "identify". Identify lets you get all sort of information about the image itself.
To get it you do this: <!--- Get image width ---> <cfexecute name="identify" arguments="-format %w image.jpg" timeout="10" variable="thewidth" /> <!--- Get image height ---> <cfexecute name="identify" arguments="-format %h image.jpg" timeout="10" variable="theheight" /> This will replace your CFIMAGE action="info" part. Then to resize your image you can use this tag: <cfexecute name="convert" arguments="image.jpg -resize 120x thumbnail.jpg" timeout="120" /> The "resize" param will obviously tell ImageMagick to resize your image. To scale it properly you only pass "one side" of the resize, like "120x" will make it 120 width and keep it proportional. Make sure to also use absolute paths to the executables, like /usr/bin/convert! ImageMagick has tones, and this is true, of different settings. But these are the ones that have worked for years and give the best result. Let me know if you need any further help. Kind Regards, Nitai On Tue, Jan 12, 2010 at 9:55 PM, Jason King <[email protected]> wrote: >> Hi Guys, > > > Does anybody know of any tutorials or anything for ImageMagick? I have it > installed and verified the installation. I'm not having any luck finding > documention on how to use cfexecute with the function. > > -Jason > > I'm trying to convert the following code for cfimagemagick > > <CFIMAGE action="info" > srcfile="#cffile.serverdirectory#/#local_photo_file#"> > > <CFIF ((cfimage.width GT 100) OR (cfimage.height GT 90)) and NOT > FileExists("#cffile.serverdirectory#/xs_#local_photo_file#")> > > <CFIF cfimage.width GT "#cfimage.height#"> > <CFSET Size = "90"> > <CFSET Percentage = Evaluate(Size / cfimage.width)> > <CFSET Percentage = Round(Percentage * 100)> > <CFELSE> > <CFSET Size = "100"> > <CFSET Percentage = Evaluate(Size / cfimage.height)> > <CFSET Percentage = Round(Percentage * 100)> > </CFIF> > > <CFIMAGE > srcfile="#cffile.serverdirectory#/#local_photo_file#" > destfile="#cffile.serverdirectory#/xs_#local_photo_file#" > action="edit" > width="#Percentage#%" > height="#Percentage#%" > uridirectory="NO" > > > > </CFIF> > -- > Open BlueDragon Public Mailing List > http://www.openbluedragon.org/ http://twitter.com/OpenBlueDragon > mailing list - http://groups.google.com/group/openbd?hl=en > > !! save a network - please trim replies before posting !! > -- See for yourself how easy it is to manage files today. Join the revolution! Razuna SaaS On-Demand - Hosted Digital Asset Management Solution http://www.razuna.com/ Razuna - Open Source Digital Asset Management http://www.razuna.org/ Follow us on Twitter http://twitter.com/razunahq
-- Open BlueDragon Public Mailing List http://www.openbluedragon.org/ http://twitter.com/OpenBlueDragon mailing list - http://groups.google.com/group/openbd?hl=en !! save a network - please trim replies before posting !!
