WebP support

@CentricWeb I wished I could have responded earlier, but I have lot of work at the moment.

I’ve been using ImageMagick for more than 15years and never switched to cfimage when it was later implemented in CFML. I might change that in future, but ImageMagick is extremly powerfull and versatile, and when there was any new fancy thing about images going on in the net, ImageMagick always have been the best path to go (at least for us).

I can’t say how reliable ImageMagick is with .webp, and we have just moved to ImageMagick-7.0.11-3-Q16-HDRI-x64-dll.exe (this is the setup file) recently.

However, basically it’s just how @Terry_Whitney already pointed out: You install ImageMagick, and then it will be available to CFML by using the cfexecute command (here an example as cftag to convert images using the legacy ImageMagick commandline. You might want to switch it to the actual command line ‘magick convert …’):

<cfexecute name="C:\Program Files\ImageMagick-7.0.11-3-Q16\Convert.exe"
		arguments="D:\path-to-your-source\image.jpg -resize x150 -quality 100 -sharpen 0x1.2 D:\path-to-your-destination\image-t.jpg"
		variable="local.imageinformation"
		timeout="5">
</cfexecute>
<cfdump var="#local.imageinformation#">

BUT (!!!) you need to make sure you have the correct permissions set up for those paths, since Lucee runs as “local service” as a good security praxis. You might need to tweak the permissions for writing/reading files to those locations and maybe also execution permissions, but that you’ll see then when implementing it.

For further reference see:

1 Like