Hello,
i try to resize an existing image (no matter if jpg or gif, same issue) forcing width to 400px with proportional height
Final result has good size but it is a crop of the upper left angle of my source image instead of smaller image. I copied code from delivered aspose example.
Image image = Image.load(inputPath);
if (!image.isCached()) {
image.cacheData();
}
System.out.println("Starting resize of " + inputPath + " (" + image.getWidth() + "x" + image.getHeight() + ") to " + width + "px width...");
image.resizeWidthProportionally(width);
// saving result
//image.save(outputPath, new JpegOptions());
image.save(outputPath);
System.out.println("File resized into : " + outputPath + " (" + image.getWidth() + "x" + image.getHeight() + ")");
I am using JDK 8
What could be wrong ?
Thank you for your help
Michel