Image resizing

Hello,
I am trying to evaluate your product and I am having problems with image resizing.

User story: I want to preview an image but if it is a large image then it should be resized on the server and send this client-side (smaller file, less bandwidth).

I have tried:
Image image = Image.load(inputFileLocation);
image.resize(100, 100);

//hard coded sizes for testing but would really want to
// keep ratio of the original picture
image.save(outputFileLocation);

Which throws a NullPointerException on the second line which I guess is related to this post is there an update to this issue?

Also tried to work around by:
BmpCreateOptions bmpCreateOptions = new BmpCreateOptions();
bmpCreateOptions.setWidth(100)
bmpCreateOptions.setHeight(100); bmpCreateOptions.setBitsPerPixel(24);
//BitsPerPixel defaults to 32 where as the image I will load will be 24 and unless this is set the //output image is completely different, is there any easy way to get the file’s BitsPerPixel?
// com.aspose.imaging.Image image = Image.load(inputFileLocation);
// int bitsPerPixel = image.getBitsPerPixel();
InputStream inputStream = new FileInputStream(inputFileLocation);
bmpCreateOptions.setSource(new StreamSource(inputStream));
Image im = Image.create(bmpCreateOptions); im.save(outputFileLocation);

Which, cuts a 100x100 square out of the image. I also tried saving with various XxxSaveOptions but all output is black.
BmpSaveOptions so = new BmpSaveOptions();
System.out.println("BmpSaveOptions bits per pixel: " + so.getBitsPerPixel()); //default 32
so.setBitsPerPixel(24); //hardcoded
System.out.println("BmpSaveOptions bits per pixel: " + so.getBitsPerPixel());

im.save(outputFileLocation, so);
// output still black even after setting BitsPerPixel

If you could please provide sample code that can get tif/gif/bmp/png/jpg to be resized, the output filetype doesn’t matter, any image type is acceptable. If you have one example I should be able to figure out the rest if they need slightly different implementations. Or direct me to any post or documentation that I may have missed.
Regards

Hi Alex,

Sorry for the inconvenience faced. Yes your image resizing issue relates to the mentioned post and unfortunately it’s still pending for analysis. Secondly I have managed to reproduce change of bitsperpixel value issue and logged the issue in our bug tracking system for further investigation and resolution. I have also linked your request to these issues and you will be notified via this thread as soon as these are resolved. Details of logged Issues are as following.

  1. IMAGING-33317 : Image resize() exception
  2. IMAGING-33351 : Bitperpixel change issue

Please feel free to contact us for any further assistance.

Best Regards,

The issues you have found earlier (filed as IMAGING-33351) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.

The issues you have found earlier (filed as IMAGING-33317) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.
(4)

The issues you have found earlier (filed as ) have been fixed in this Aspose.Words for JasperReports 18.3 update.