Copy link to clipboard
Copied
Coludfusion version: 2018
Goal is to manipulate images when given x and y coordinates from clients for adding text(s) and e-sign or thumbnail images onto parent image without comprimising the resolution (pixels) and dimenssions of the image. I tried all different image functions available with no much luck.
Looking to find solution either by using third party tool, upgrading coldfusion version or purchasing add ons to coldfusion engine. Does any one has any suggustions?
Copy link to clipboard
Copied
I think that the use-cases that you mention will be best served by a specialist imaging application or library. You might have to buy it or to pay to use it..
Search for one that ticks all your boxes. When you find it, return to the forum and let's discuss whether it can be integrated in ColdFusion.
Copy link to clipboard
Copied
What classess does cfimage uses to process images?
ImagePlus and ImageProcessor from ImageJ library was one of my options.
Copy link to clipboard
Copied
ImgLib2, ImageIMAJ as well
Copy link to clipboard
Copied
Interested in using the command line? (This has been our approach for manipulating and generating images and PDFs using ColdFusion 8-2021. This has allowed for more options, faster generation, multithreading & better quality.)
GraphicMagick? (It's opensource. I've used this to add text to images.)
If you want to create a new image, I've used WKHTMLTOPDF (opensource) to generate PDFs from modern HTML that overlays images & SVG images (with transparancies or alpha channel opaqueness) over other elements. There's also a WKHTMLTOIMAGE executable that would convert the HTML to PNG/JPG. You could use document size and CSS to enforce the same dimensions.
Copy link to clipboard
Copied
Thank You for your response. I cannot use commnad line becasue these needs to be built on-demand. I also cannot use HTML because our client provides images
Copy link to clipboard
Copied
I was able to manupulate using image tags and I believe I got most of it working except I cannot use the fonts that I really want to use
local.dupImage = arguments.coldfusionImage;
local.imageInfo = ImageInfo(local.dupImage);
ImageSetAntialiasing(local.dupImage);
ImageSetDrawingColor(local.dupImage,arguments.lineConfig["lineColor"]);
//Had to use bufferImage and other objects to correctly determine x and y coordinates.
//Used this as basis https://www.bennadel.com/blog/1150-gettextdimensions-for-finding-coldfusion-image-text-dimensions.htm
local.attributeCollect = {};
local.attributeCollect["font"] = arguments.lineConfig["lineFont"];
local.attributeCollect["size"] = arguments.lineConfig["lineFontSize"];
local.attributeCollect["style"] = arguments.lineConfig["lineFontStyle"];
local.dupImage.drawText(arguments.lineConfig["lineText"], local.xCenterFinal, local.ycenter,local.attributeCollect);
Copy link to clipboard
Copied
Thanks for sharing that.
Which fonts do you want to use?