Image Rotate and Flip Licensing Plugin
Seamlessly adjust the orientation of a photo or image to a fixed or arbitrarily selected angle, with or without flipping, utilizing the capabilities of the Image Rotate and Flip License plugin. Before executing these transformations, it's crucial to obtain a Metered license by providing your public and private keys through the `setMeteredKey()` method. Import image files in various formats from the supported list, then apply the rotate() method to specify the desired angle or use the rotateFlip() method to flip the image. Finally, save the edited image in the supported format. Please note that using unlicensed features of the Aspose.Imaging graphic library will result in a watermark being applied to the output image.
import com.aspose.imaging.Image; | |
import com.aspose.imaging.Metered; | |
import com.aspose.imaging.RasterImage; | |
import com.aspose.imaging.RotateFlipType; | |
import com.aspose.imaging.imageoptions.JpegOptions; | |
import java.io.File; | |
//------------------------------------------------------------------ | |
// Image rotate-flip plug-in example | |
//------------------------------------------------------------------ | |
// Valid Image rotate-flip | |
Metered license = new Metered(); | |
// Only metered plug-in license is supported | |
license.setMeteredKey("<your public key>", "<your private key>"); | |
// get path of the input data | |
String templatesFolder = System.getenv("DATA_PATH"); | |
if (templatesFolder == null) | |
{ | |
templatesFolder = "c:\\Users\\USER\\Downloads\\templates\\"; | |
} | |
// get output path | |
String outputFolder = System.getenv("OUT_PATH"); | |
if (outputFolder == null) | |
{ | |
outputFolder = templatesFolder; | |
} | |
try (RasterImage image = (RasterImage) Image.load(templatesFolder + "multipage.tif")) | |
{ | |
String filePath = outputFolder + "rotate_template.jpg"; | |
image.rotate(45); | |
image.save(filePath, new JpegOptions()); | |
new File(filePath).delete(); | |
} | |
try (RasterImage image = (RasterImage) Image.load(templatesFolder + "multipage.tif")) | |
{ | |
String filePath = outputFolder + "flipped_template.jpg"; | |
image.rotateFlip(RotateFlipType.Rotate270FlipX); | |
image.save(filePath, new JpegOptions()); | |
new File(filePath).delete(); | |
} |
Explore the functionalities and capabilities of our free online Aspose.Imaging Flip&Rotate Application website.