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
I suggest you to please try using the example code given over following thread link. If there is still an issue then please share the source file and generated output with us that is reproducing the issue.
And this example doesn’t work for me.
When i load image (original.jpg) then call “image.resizeWidthProportionally(400);”, it crops the image (see aspose_resized_output.jpg) instead of resizing it (expected_output.jpg)
I guess it is very easy to reproduce ( i use aspose-imaging-20.12-jdk16.jar)
I have created an issue with ID IMAGINGJAVA-7800 in our issue tracking system to further investigate and resolve the issue. This thread has been linked with the issue so that you may be notified once the issue will be fixed.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.