How to use programmatically imagemagick in aem?
want to Convert image in aem as imagemagic takes realpath(c:\path) but i am unable to provide it.
want to implement in programatically without using CommandLineProcess step.
want to Convert image in aem as imagemagic takes realpath(c:\path) but i am unable to provide it.
want to implement in programatically without using CommandLineProcess step.
Hi
Use JMagick (docs). Read the documentation.
It provides all the functionality of ImageMagick. You may also look into another ImageMagick Java wrapper, im4java.
There is a good starters document for im4java here
//
Here is an example,
/** Typical scaling implementation using JMagick **/ ImageInfo origInfo = new ImageInfo(absPath); //load image info MagickImage image = new MagickImage(origInfo); //load image image = image.scaleImage(finalWidth, finalHeight); //to Scale image image.setFileName(absNewFilePath); //give new location image.writeImage(origInfo); //save
Now you just need to create a custom component/Service to achieve the needful.
Thanks and Regards
Kautuk Sahni
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.