Endless "readFully" when converting docx with special TIF to PDF

We encountered a problem with the given DOCX where a TIF seems to cause aspose to infinite processing in “readFully”.

We used the latest version 24.1 and Java 17 in the attached example.
endlessRunningReadFully.zip (42.1 KB)

As we can’t interrupt the thread this doesn’t only have an effect for this single file.

Here is the stacktrace of the ‘stuck’ processing:

 java.lang.Exception
 	at app//com.aspose.words.internal.zzCr.readFully(Unknown Source)
 	at app//com.aspose.words.internal.zzCr.readFully(Unknown Source)
 	at app//com.aspose.words.internal.zzW4R.zzYKF(Unknown Source)
 	at app//com.aspose.words.internal.zzXFI.zzZKg(Unknown Source)
 	at app//com.aspose.words.internal.zzXoE.zzXK2(Unknown Source)
 	at app//com.aspose.words.internal.zzXoE.zziA(Unknown Source)
 	at app//com.aspose.words.internal.zzXoE.zzXYK(Unknown Source)
 	at app//com.aspose.words.internal.zzXoE.zzYB4(Unknown Source)
 	at app//com.aspose.words.internal.zzWpk.zzXK2(Unknown Source)
 	at app//com.aspose.words.internal.zzWLb.zzWS3(Unknown Source)
 	at app//com.aspose.words.internal.zzXdv.zzXK2(Unknown Source)
 	at app//com.aspose.words.internal.zzXdv.zzXK2(Unknown Source)
 	at app//com.aspose.words.internal.zzXdv.<init>(Unknown Source)
 	at app//com.aspose.words.zzXNz.zzXK2(Unknown Source)
 	at app//com.aspose.words.zzWbY.zzXK2(Unknown Source)
 	at app//com.aspose.words.zzVVl.zzXK2(Unknown Source)
 	at app//com.aspose.words.zzVVl.zzXK2(Unknown Source)
 	at app//com.aspose.words.zzVVl.zzXK2(Unknown Source)
 	at app//com.aspose.words.zzZ0M.zzXf1(Unknown Source)
 	at app//com.aspose.words.zzZ0M.zzXK2(Unknown Source)
 	at app//com.aspose.words.zzXDS.zzXK2(Unknown Source)
 	at app//com.aspose.words.zzXDS.zzXK2(Unknown Source)
 	at app//com.aspose.words.zzXfp.zzYgl(Unknown Source)
 	at app//com.aspose.words.zzXfp.zzYtJ(Unknown Source)
 	at app//com.aspose.words.zzXfp.zzVWC(Unknown Source)
 	at app//com.aspose.words.zzZY0.zzWZa(Unknown Source)
 	at app//com.aspose.words.zzj6.zzWwo(Unknown Source)
 	at app//com.aspose.words.zzj6.zzWAr(Unknown Source)
 	at app//com.aspose.words.zzWhD.zzXK2(Unknown Source)
 	at app//com.aspose.words.zzWhD.zzYKF(Unknown Source)
 	at app//com.aspose.words.zzWhD.zzWS3(Unknown Source)
 	at app//com.aspose.words.zzWhD.zzX8x(Unknown Source)
 	at app//com.aspose.words.zzWhD.zzYKF(Unknown Source)
 	at app//com.aspose.words.zzWhD.zzXK2(Unknown Source)
 	at app//com.aspose.words.zzZkc.zzXVl(Unknown Source)
 	at app//com.aspose.words.zzZkc.zziA(Unknown Source)
 	at app//com.aspose.words.zzZkc.zzYKF(Unknown Source)
 	at app//com.aspose.words.zzX1V.zzY8L(Unknown Source)
 	at app//com.aspose.words.zzX1V.zzkI(Unknown Source)
 	at app//com.aspose.words.zzX1V.zzYpZ(Unknown Source)
 	at app//com.aspose.words.zzX1V.zzXZ1(Unknown Source)
 	at app//com.aspose.words.zzX8e.zzXZ1(Unknown Source)
 	at app//com.aspose.words.zzWaA.zzWS3(Unknown Source)
 	at app//com.aspose.words.zzZdT.zzZxq(Unknown Source)
 	at app//com.aspose.words.zzXsE.zzi(Unknown Source)
 	at app//com.aspose.words.Document.updatePageLayout(Unknown Source)
 	at app//com.aspose.words.Document.zzeK(Unknown Source)
 	at app//com.aspose.words.Document.getPageCount(Unknown Source)
 	at app//com.aspose.words.zzFL.zzWS3(Unknown Source)
 	at app//com.aspose.words.zzFL.zzXK2(Unknown Source)
 	at app//com.aspose.words.zzZTm.zzXK2(Unknown Source)
 	at app//com.aspose.words.Document.zzWS3(Unknown Source)
 	at app//com.aspose.words.Document.zzXK2(Unknown Source)
 	at app//com.aspose.words.Document.zzXK2(Unknown Source)
 	at app//com.aspose.words.Document.save(Unknown Source)
 	at app//Main.convertDocxToPdf(Main.java:116)
 	at app//Main.lambda$main$0(Main.java:80)
 	at app//Main$$Lambda$20/0x0000000800c01538.run(Unknown Source)
 	at java.base@17/java.lang.Thread.run(Thread.java:833)

@orgavision TIF format is not directly supported by Aspose.Words. To process TIF images you should add additional dependencies:
https://docs.aspose.com/words/java/system-requirements/#optional-dependencies

You can try adding the following to the POM file:

<dependency>
    <groupId>javax.media.jai</groupId>
    <artifactId>com.springsource.javax.media.jai.core</artifactId>
    <version>1.1.3</version>
</dependency>

@alexey.noskov
Thank you for your prompt reply.

There seems to be a problem with this special TIF and I tried the external lib.
Aspose now doesn’t end up in a loop and the resulting PDF displays an error image in place of TIF. This leads me to think that the external library might be handling an error within the TIF file.

On another note, Aspose.Words successfully processes other TIF files, and we are currently using Java 17. The library you suggested dates back to 2009.

Is there a way for Aspose to either fail gracefully or insert an error image by itself when encountering this particular issue, instead of consuming CPU resources indefinitely? The stack trace points to ‘readFully’. Perhaps there’s a possibility to modify the behavior at this juncture?

@orgavision
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): WORDSJAVA-2920

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.

1 Like

The issues you have found earlier (filed as WORDSJAVA-2920) have been fixed in this Aspose.Words for Java 24.3 update.