Loading pptx file by Aspose Slides for Java 17.4 simply fails with exception. The cause for this - broken jpeg file inside document.
MS Powerpoint just ignores incorrect image. Same behavior is expected from the library. (and it worked that way at least at 15.6.1 version).
Test file with broken image is attached.
Code snippet to load the document:
License license = new License();
license.setLicense(“Aspose.Total.Java.lic”);
Presentation presentation = new Presentation(INPUT_FOLDER + “broken_image.pptx”);
Part of Stack trace that is thrown:
Exception in thread “main” class com.aspose.slides.PptxReadException: class com.aspose.slides.ms.core.System.Drawing.imagecodecs.p7cce53cf.pbdb106a0.pbdb106a0.pa5e0ff62.b —> class com.aspose.slides.ms.core.System.Drawing.imagecodecs.p7cce53cf.pbdb106a0.pbdb106a0.pa5e0ff62.e: Corrupted Jpeg scan component id definition. Cannot load image.
com.aspose.slides.ms.core.System.Drawing.imagecodecs.p7cce53cf.pbdb106a0.pbdb106a0.p2cbca448.pa2137a2a.ad.do(Unknown Source)
com.aspose.slides.ms.core.System.Drawing.imagecodecs.p7cce53cf.pbdb106a0.pbdb106a0.p2cbca448.pa2137a2a.p6a2feef8.a.do(Unknown Source)
com.aspose.slides.ms.core.System.Drawing.imagecodecs.p7cce53cf.pbdb106a0.pa2137a2a.pbdb106a0.b.do(Unknown Source)
com.aspose.slides.ms.core.System.Drawing.imagecodecs.jpeg.pf4dd765c.a.do(Unknown Source)
com.aspose.slides.ms.core.System.Drawing.imagecodecs.jpeg.pf4dd765c.a.do(Unknown Source)
com.aspose.slides.ms.core.System.Drawing.imagecodecs.p7cce53cf.pbdb106a0.pbdb106a0.bb$d.do(Unknown Source)
com.aspose.slides.ms.core.System.Drawing.imagecodecs.p7cce53cf.pbdb106a0.pbdb106a0.as.do(Unknown Source)
com.aspose.slides.ms.core.System.Drawing.imagecodecs.p7cce53cf.pbdb106a0.pbdb106a0.as.do(Unknown Source)
com.aspose.slides.ms.core.System.Drawing.imagecodecs.p7cce53cf.pbdb106a0.pbdb106a0.as.do(Unknown Source)
com.aspose.slides.ms.core.System.Drawing.imagecodecs.p7cce53cf.pbdb106a0.pbdb106a0.bb.for(Unknown Source)
com.aspose.slides.ms.core.System.Drawing.imagecodecs.p7cce53cf.pbdb106a0.pbdb106a0.bb.do(Unknown Source)
com.aspose.slides.ms.core.System.Drawing.imagecodecs.p7cce53cf.pbdb106a0.pbdb106a0.bb.do(Unknown Source)
com.aspose.slides.ms.core.System.Drawing.imagecodecs.p7cce53cf.pbdb106a0.pbdb106a0.bb.int(Unknown Source)
com.aspose.slides.ms.core.System.Drawing.imagecodecs.p7cce53cf.pbdb106a0.pbdb106a0.bb.new(Unknown Source)
com.aspose.slides.ms.core.System.Drawing.imagecodecs.jpeg.pf4dd765c.d.read(Unknown Source)
javax.imageio.ImageReader.read(ImageReader.java:940)
com.aspose.slides.ms.core.System.Drawing.imagecodecs.jpeg.JpegImageReader.read(Unknown Source)
…Currently I don’t have access to latest 17.5 version of library - so please don’t suggest me to check it with that version of library.