Hi,
I tried to convert a mail to pdf using the code in the attachment. Aspose.Words fails with following Exception (with prerequisite JAI 1.1.3):
java.lang.Exception: javax.media.jai.util.ImagingException: All factories fail for the operation "stream"
at com.aspose.words.internal.zzN3.zzZ(Unknown Source)
at com.aspose.words.internal.zzN3.zzY(Unknown Source)
at com.aspose.words.internal.zzN3.zzZ(Unknown Source)
at com.aspose.words.internal.zzN3.zzY(Unknown Source)
at com.aspose.words.internal.zzYC.zzZ(Unknown Source)
at com.aspose.words.internal.zzYC.<init>(Unknown Source)
at com.aspose.words.internal.zzYC.<init>(Unknown Source)
at com.aspose.words.zzZNR.zzYM(Unknown Source)
at com.aspose.words.zzZNR.zz3(Unknown Source)
at com.aspose.words.zzZNR.setImageBytes(Unknown Source)
at com.aspose.words.ImageData.setImageBytes(Unknown Source)
at com.aspose.words.DocumentBuilder.insertImage(Unknown Source)
at com.aspose.words.DocumentBuilder.insertImage(Unknown Source)
at com.aspose.words.DocumentBuilder.insertImage(Unknown Source)
at com.aspose.words.zzZTX.zzZ(Unknown Source)
at com.aspose.words.zzZTX.zzZ(Unknown Source)
at com.aspose.words.zzZTX.zzz(Unknown Source)
at com.aspose.words.zzZTX.zzZ(Unknown Source)
at com.aspose.words.zzZTX.zzZ(Unknown Source)
at com.aspose.words.zzZTX.zzN(Unknown Source)
at com.aspose.words.zzZTX.zzO(Unknown Source)
at com.aspose.words.zzZTX.zzN(Unknown Source)
at com.aspose.words.zzZTX.zzO(Unknown Source)
at com.aspose.words.zzZTX.zzN(Unknown Source)
at com.aspose.words.zzZTX.zzO(Unknown Source)
at com.aspose.words.zzZTX.zzZ(Unknown Source)
at com.aspose.words.zzZGJ.zzT(Unknown Source)
at com.aspose.words.zzZGJ.zzY(Unknown Source)
at com.aspose.words.zzZGJ.zzZ(Unknown Source)
at com.aspose.words.zzZGJ.zzY(Unknown Source)
at com.aspose.words.zzZGJ.zzZ(Unknown Source)
at com.aspose.words.zzZGJ.zzZ(Unknown Source)
at com.aspose.words.zzZGM.read(Unknown Source)
at com.aspose.words.Document.zzY(Unknown Source)
at com.aspose.words.Document.zzZ(Unknown Source)
at com.aspose.words.Document.<init>(Unknown Source)
at com.aspose.words.Document.<init>(Unknown Source)
[...]
Caused by: javax.media.jai.util.ImagingException: All factories fail for the operation "stream"
at javax.media.jai.OperationRegistry.invokeFactory(OperationRegistry.java:1687)
at javax.media.jai.ThreadSafeOperationRegistry.invokeFactory(ThreadSafeOperationRegistry.java:473)
at javax.media.jai.registry.RIFRegistry.create(RIFRegistry.java:332)
at javax.media.jai.RenderedOp.createInstance(RenderedOp.java:819)
at javax.media.jai.RenderedOp.createRendering(RenderedOp.java:867)
at javax.media.jai.RenderedOp.getColorModel(RenderedOp.java:2242)
at javax.media.jai.PlanarImage.getAsBufferedImage(PlanarImage.java:2498)
at javax.media.jai.PlanarImage.getAsBufferedImage(PlanarImage.java:2546)
at com.aspose.words.internal.zzME.zzZ(Unknown Source)
at com.aspose.words.internal.zzN3.zzY(Unknown Source)
... 90 more
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:90)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55)
at java.lang.reflect.Method.invoke(Method.java:508)
at javax.media.jai.FactoryCache.invoke(FactoryCache.java:122)
at javax.media.jai.OperationRegistry.invokeFactory(OperationRegistry.java:1674)
... 99 more
Caused by: com.sun.media.jai.codecimpl.util.ImagingException
at com.sun.media.jai.codecimpl.ImagingListenerProxy.errorOccurred(ImagingListenerProxy.java:63)
at
com.sun.media.jai.codecimpl.GIFImageDecoder.decodeAsRenderedImage(GIFImageDecoder.java:177)
at com.sun.media.jai.codec.ImageDecoderImpl.decodeAsRenderedImage(ImageDecoderImpl.java:140)
at com.sun.media.jai.opimage.StreamRIF.create(StreamRIF.java:135)
... 105 more
Caused by: com.sun.media.jai.codecimpl.util.ImagingException: Error reading GIF image data.
... 108 more
Caused by: java.io.IOException: Error reading GIF image header.
at com.sun.media.jai.codecimpl.GIFImage.<init>(GIFImageDecoder.java:327)
at
com.sun.media.jai.codecimpl.GIFImageDecoder.decodeAsRenderedImage(GIFImageDecoder.java:162)
Code + Mail: test.zip (601.1 KB)
The error is inside of JAI, but would it be possible to handle this error and generate a document without this gif?
Regards