medata提取器lib中的ArrayIndexOutOfBoundsException错误

时间:2015-10-04 15:16:33

标签: android image metadata

我在android版本中使用了metada-exttractor:2.7.0。

这个lib有时会抛出这个异常:`

    STACK_TRACE=java.lang.RuntimeException: An error occured while executing doInBackground()
at android.os.AsyncTask$3.done(AsyncTask.java:300)
at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:355)
at java.util.concurrent.FutureTask.setException(FutureTask.java:222)
at java.util.concurrent.FutureTask.run(FutureTask.java:242)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:848)
Caused by: java.lang.ArrayIndexOutOfBoundsException: length=256; index=352
at java.lang.Byte.valueOf(Byte.java:299)
at com.drew.imaging.jpeg.JpegSegmentData.getOrCreateSegmentList(Unknown Source)
at com.drew.imaging.jpeg.JpegSegmentData.addSegment(Unknown Source)
at com.drew.imaging.jpeg.JpegSegmentReader.readSegments(Unknown Source)
at com.drew.imaging.jpeg.JpegMetadataReader.process(Unknown Source)
at com.drew.imaging.jpeg.JpegMetadataReader.readMetadata(Unknown Source)
at com.drew.imaging.jpeg.JpegMetadataReader.readMetadata(Unknown Source)
at com.drew.imaging.ImageMetadataReader.readMetadata(Unknown Source)
at com.drew.imaging.ImageMetadataReader.readMetadata(Unknown Source)
at com.hexar.filebroswer.database.PhotoRecord.getLastModifyDate(PhotoRecord.java:99)

这有时仅在相同的情况下抛出,我无法捕获或解决此问题,因为在库中....

1 个答案:

答案 0 :(得分:1)

它可能是图片中损坏的元数据。你试过其他图像了吗?

此论坛post似乎表明这是其他一些用户的原因。