Image save issue

Hi, When I try to save an image detected through a imageplacement to stream

try (ByteArrayOutputStream outputStream = new ByteArrayOutputStream()) {
imagePlacement.getImage().save(outputStream, ImageType.getPng());
return outputStream.toByteArray();
}

Getting the following Exception?

Exception: java.lang.ArrayIndexOutOfBoundsException: Index -1 out of bounds for length 4
at com.aspose.pdf.internal.l8t.lf.lI(Unknown Source)
at com.aspose.pdf.internal.l8t.lf.lI(Unknown Source)
at com.aspose.pdf.internal.l6l.lI.lI(Unknown Source)
at com.aspose.pdf.internal.l6l.lI.lI(Unknown Source)
at com.aspose.pdf.internal.l3f.lu.lI(Unknown Source)
at com.aspose.pdf.XImage.lI(Unknown Source)
at com.aspose.pdf.XImage.saveInternal(Unknown Source)
at com.aspose.pdf.XImage.saveInternal(Unknown Source)
at com.aspose.pdf.XImage.save(Unknown Source)

@Praveen1509

If possible, can you please share your sample file for our reference? We will test the scenario in our environment and address it accordingly.

Competitive Analysis.pdf (3.9 MB)

@Praveen1509

We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): PDFJAVA-44297

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

The issues you have found earlier (filed as PDFJAVA-44297) have been fixed in Aspose.PDF for Java 24.10.