Hi Aspose Support Team,
We use java aspose-imaging (version 20.4 / 21.2 / 21.4) to convert tiff file to tiff or jpg format, and got below error on some tiff image:
class com.aspose.imaging.coreexceptions.ImageSaveException: Image export failed. —> java.lang.ArrayIndexOutOfBoundsException: 1208
— End of inner exception stack trace —
com.aspose.imaging.Image.a(Unknown Source)
com.aspose.imaging.RasterImage.a(Unknown Source)
com.aspose.imaging.p.a(Unknown Source)
com.aspose.imaging.internal.ol.b.a(Unknown Source)
com.aspose.imaging.internal.ol.c.a(Unknown Source)
com.aspose.imaging.Image.save(Unknown Source)
image.demo.AsposeImageConverterUtils.convertImageToImage(AsposeImageConverterUtils.java:113)
image.demo.AsposeImageConverterUtilsTest.convertTifToTifCoruppted(AsposeImageConverterUtilsTest.java:177)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:498)
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
org.junit.runners.ParentRunner.run(ParentRunner.java:363)
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:89)
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:41)
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:541)
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:763)
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:463)
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:209)
at com.aspose.imaging.Image.a(Unknown Source)
at com.aspose.imaging.RasterImage.a(Unknown Source)
at com.aspose.imaging.p.a(Unknown Source)
at com.aspose.imaging.internal.ol.b.a(Unknown Source)
at com.aspose.imaging.internal.ol.c.a(Unknown Source)
at com.aspose.imaging.Image.save(Unknown Source)
at image.demo.AsposeImageConverterUtils.convertImageToImage(AsposeImageConverterUtils.java:113)
at image.demo.AsposeImageConverterUtilsTest.convertTifToTifCoruppted(AsposeImageConverterUtilsTest.java:177)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:89)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:41)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:541)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:763)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:463)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:209)
Caused by: java.lang.ArrayIndexOutOfBoundsException: 1208
at com.aspose.imaging.internal.ja.c.a(Unknown Source)
at com.aspose.imaging.internal.at.c.b(Unknown Source)
at com.aspose.imaging.internal.at.c.a(Unknown Source)
at com.aspose.imaging.internal.at.x.b(Unknown Source)
at com.aspose.imaging.internal.at.x.a(Unknown Source)
at com.aspose.imaging.internal.fy.b.a(Unknown Source)
at com.aspose.imaging.internal.fy.g.a(Unknown Source)
at com.aspose.imaging.internal.ad.a.a(Unknown Source)
at com.aspose.imaging.internal.an.bg.a(Unknown Source)
at com.aspose.imaging.internal.an.bg.a(Unknown Source)
at com.aspose.imaging.internal.an.bg.a(Unknown Source)
at com.aspose.imaging.internal.fy.g.a(Unknown Source)
at com.aspose.imaging.internal.fq.f.loadPartialArgb32Pixels(Unknown Source)
at com.aspose.imaging.internal.an.be.a(Unknown Source)
at com.aspose.imaging.internal.an.bg.a(Unknown Source)
at com.aspose.imaging.internal.an.bg.a(Unknown Source)
at com.aspose.imaging.internal.an.bg.a(Unknown Source)
at com.aspose.imaging.internal.an.aE.a(Unknown Source)
at com.aspose.imaging.RasterImage.a(Unknown Source)
at com.aspose.imaging.RasterImage.loadPartialArgb32Pixels(Unknown Source)
at com.aspose.imaging.fileformats.tiff.TiffFrame.a(Unknown Source)
at com.aspose.imaging.internal.aG.L.a(Unknown Source)
at com.aspose.imaging.internal.aG.G.a(Unknown Source)
at com.aspose.imaging.internal.aG.t.a(Unknown Source)
at com.aspose.imaging.internal.aG.t.b(Unknown Source)
at com.aspose.imaging.internal.aG.t.export(Unknown Source)
… 31 more
These tiff images are production files & they are confident. So we could send you the code that we run only. Please find attached file for sample code & support us for this case.
P/S: we run convertTifToTifCoruppted method on image-converter-demo\src\test\java\image\demo\AsposeImageConverterUtilsTest.java for this case. And you need to add Aspose.Total.Java.lic file to image-converter-demo\src\main\resources to run.
We also try to save image inputstream to RandomAccessFile. After that we load this RandomAccessFile as a RasterImage, but still got below error:
com.aspose.imaging.coreexceptions.imageformats.TiffImageException: The strip 0 has corrupt data and cannot be decoded. Error: There is no more data to read.
image-converter-demo.zip (595.9 KB)
Thanks.