githubEdit

Image Manipulation

Both CFML engines (Lucee & Adobe) have a very extensive and awesome image manipulation library that will allow you to create and manipulate images in an easy syntax. We cannot see every single detail about image manipulation, but it is necessary to understand that this functionality is easy in CFML and it exists.

Apart from having core image functions all functions can be applied as member functions to an image object. Yes, CFML allows you to deal with image objects natively.

imgObj = imageRead("http://cfdocs.org/apple-touch-icon.png");
imgObj.resize(50,50);
cfimage(action="writeToBrowser", source=imgObj);

imgObj = imageRead("http://cfdocs.org/apple-touch-icon.png");
imgObj.blur(5);
cfimage(action="writeToBrowser", source=imgObj);

imgObj = imageRead("http://cfdocs.org/apple-touch-icon.png");
imgObj.rotate(90);
cfimage(action="writeToBrowser", source=imgObj);

imgObj = imageRead("http://cfdocs.org/apple-touch-icon.png");
info = imgObj.info();
writeDump(info);

You can find some great samples here: https://cfdocs.org/cfimagearrow-up-right and a listing of all manipulation functions here: https://cfdocs.org/image%2Dfunctionsarrow-up-right

Last updated

Was this helpful?