0

I'm new to Railo, moving away from ColdFusion 8 where my site used to used to use cfx_imagecr3.

I believe Railo has ImageScaleToFit but I'm not sure if I'm using it correctly or if I need to add some kind of class/component? I've added it between a cfscript but i get 'invalid variable declaration' which doest make any sense to me. Any help appreciated.

I'm running railo-4.0.0.013 on ubuntu 12.04

<cfscript>
        imageScaletoFit('/home/images/testimage.jpg','90','114','highestPerformance');
</cfscript>
Peter Boughton
  • 110,170
  • 32
  • 120
  • 176
david-l
  • 623
  • 1
  • 9
  • 20

1 Answers1

0

You need to first load the image into a variable, then use that variable name inside ImageScaletoFit, like so:

<cfimage name="ImgVariable" source="/home/images/testimage.jpg" />

<cfset imageScaletoFit(ImgVariable,'90','114','highestPerformance') />

(This isn't specific to Railo - the function exists and works the same way in CF8+)

Peter Boughton
  • 110,170
  • 32
  • 120
  • 176
  • Thank you for your time, i've never used cfimage and didnt know imageScaletoFit worked in conjunction with cfimage – david-l Aug 25 '12 at 12:48