PptxReadException when inserting an image into PPTX presentation

Hi,

When inserting an image to a PPTX presentation, we are getting the following error - for some images:
com.aspose.slides.pptx.PptxException$PptxReadException: Couldn’t load image from stream.

Please see the 2 attached images - both jpg files. All works OK when inserting image.jpg; and we get an error with imageError.jpg.

This is the code snippet I use to replicate the issue:

PresentationEx pres = new PresentationEx( “C:/insertImageTest.pptx”);
FileInputStream imageStream = new FileInputStream( “c:/imageError.jpg”);
ImageEx imageEx = pres.getImages().addImage( imageStream );
ShapesEx shapesEx = pres.getSlides().get(0).getShapes();
Integer index = shapesEx.addPictureFrame( ShapeTypeEx.RECTANGLE, 50, 50, 50, 50, imageEx );
pres.save( “c:/insertImageTestOut.pptx”, SaveFormat.PPTX );

We use Aspose Slides version 2.9.6.

Please let us know if this can be fixed or if there is any other way to insert the imageError.jpg into a presentation without an error.

Thanks,

Natasa

Hi Natasa,


I have observed the sample code and have tested with Aspose.Slides for Java 7.3.0. I have been able to observe the issue specified. An issue with ID SLIDESJAVA-33896 has been created 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 automatically notified once the issue will be resolved.

We are sorry for your inconvenience,

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


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