Recently upgraded from words 22.7 to 24.4 and started receiving an exception when calling shape.getImageData().getImageType() on a word document. I verified rolling back to 22.7 the issue is no longer present.
java.lang.NullPointerException: Cannot invoke "String.indexOf(String)" because "<parameter1>" is null
at com.aspose.words.internal.zzWkY.zzH(Unknown Source)
at com.aspose.words.internal.zzWkY.zzY62(Unknown Source)
at com.aspose.words.internal.zzYLj.zz0B(Unknown Source)
at com.aspose.words.internal.zzYLj.zzWzE(Unknown Source)
at com.aspose.words.internal.zzYLj.zzWUN(Unknown Source)
at com.aspose.words.internal.zzYLj.zzYNC(Unknown Source)
at com.aspose.words.zzXHy.zzYpJ(Unknown Source)
at com.aspose.words.ImageData.getImageType(Unknown Source)
@cpost Thank you for additional information. Unfortunately, I cannot reproduce the problem using the following simple code:
Document doc = new Document("C:\\Temp\\in.doc");
for (Shape s : (Iterable<Shape>)doc.getChildNodes(NodeType.SHAPE, true))
{
if (s.hasImage())
System.out.println(s.getImageData().getImageType());
}
PS: You can zip and attach document directly in the forum.
@cpost Thank you for additional information. Unfortunately, the problem is still not reproducible on my side. The provided code works fine and does not throw any exceptions.
@cpost Unfortunately, we still cannot reproduce the problem on our side. Without ability to reproduce the problem we cannot analyze it. If possible please create a simple application that will allow us to reproduce the problem.