greyovo/PicQuery

Crashed while indexing albums

Closed this issue · 6 comments

Exception java.io.FileNotFoundException:
  at android.database.DatabaseUtils.readExceptionWithFileNotFoundExceptionFromParcel (DatabaseUtils.java:149)
  at android.content.ContentProviderProxy.openTypedAssetFile (ContentProviderNative.java:705)
  at android.content.ContentResolver.openTypedAssetFileDescriptor (ContentResolver.java:1689)
  at android.content.ContentResolver.openTypedAssetFile (ContentResolver.java:1594)
  at android.content.ContentResolver.lambda$loadThumbnail$0 (ContentResolver.java:3593)
  at android.content.-$$Lambda$ContentResolver$7ILY1SWNxC2xhk-fQUG6tAXW9Ik.call
  at android.graphics.ImageDecoder$CallableSource.createImageDecoder (ImageDecoder.java:550)
  at android.graphics.ImageDecoder.decodeBitmapImpl (ImageDecoder.java:1847)
  at android.graphics.ImageDecoder.decodeBitmap (ImageDecoder.java:1840)
  at android.content.ContentResolver.loadThumbnail (ContentResolver.java:3592)
  at android.content.ContentResolver.loadThumbnail (ContentResolver.java:3576)
  at me.grey.picquery.domain.ImageSearcher.encodePhotoList (ImageSearcher.kt:116)
  at me.grey.picquery.domain.ImageSearcher$encodePhotoList$1.invokeSuspend
  at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith (ContinuationImpl.kt:33)
  at kotlinx.coroutines.DispatchedTask.run (DispatchedTask.kt:106)
  at kotlinx.coroutines.EventLoopImplBase.processNextEvent (EventLoop.common.kt:280)
  at kotlinx.coroutines.BlockingCoroutine.joinBlocking (Builders.kt:85)
  at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking (Builders.kt:59)
  at kotlinx.coroutines.BuildersKt.runBlocking
  at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking$default (Builders.kt:38)
  at kotlinx.coroutines.BuildersKt.runBlocking$default
  at me.grey.picquery.domain.AlbumManager$encodeAlbums$2.invokeSuspend (AlbumManager.kt:103)
  at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith (ContinuationImpl.kt:33)
  at kotlinx.coroutines.DispatchedTask.run (DispatchedTask.kt:106)
  at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely (CoroutineScheduler.kt:584)
  at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask (CoroutineScheduler.kt:793)
  at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker (CoroutineScheduler.kt:697)
  at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run (CoroutineScheduler.kt:684)

猜测是某些相册中包含了非jpg/png的图片,或是系统没有创建缩略图(对loadThumbnails API支持不完善)导致无法创建和读取缩略图(FileNotFoundException)。索引编码时是输入的是照片的缩略图而不是原图

可能的解决方案:在捕获错误后,使用备用的图片降采样方法读取缩略图,位于imageutils

可能的解决方案:在捕获错误后,使用备用的图片降采样方法读取缩略图,位于imageutils

希望早日修复,现在最大的相册索引的时候崩溃,无法使用

另一种崩溃的报错堆栈,似乎和 ONNX 有关

# DefaultDispatcher-worker-2(31614)

SIGABRT

#00 pc 000000000007da34 /apex/com.android.runtime/lib64/bionic/libc.so (abort+168) [arm64-v8a::e9653d1f6c173c6b86b171a5be6af6eb]
#01 pc 000000000007da04 /apex/com.android.runtime/lib64/bionic/libc.so (abort+120) [arm64-v8a::e9653d1f6c173c6b86b171a5be6af6eb]
java:
ai.onnxruntime.OrtSession.ai.onnxruntime.OrtSession$Result run(java.util.Map,java.util.Set,ai.onnxruntime.OrtSession$RunOptions)(OrtSession.java:0)
ai.onnxruntime.OrtSession.ai.onnxruntime.OrtSession$Result run(java.util.Map,java.util.Set)(OrtSession.java:0)
ai.onnxruntime.OrtSession.ai.onnxruntime.OrtSession$Result run(java.util.Map)(OrtSession.java:0)
me.grey.picquery.domain.encoder.ImageEncoder$encode$2.java.lang.Object invokeSuspend(java.lang.Object)(ImageEncoder.java:0)
kotlin.coroutines.jvm.internal.BaseContinuationImpl.void resumeWith(java.lang.Object)(BaseContinuationImpl.java:7)
kotlinx.coroutines.DispatchedTask.void run()(DispatchedTask.java:109)
kotlinx.coroutines.scheduling.CoroutineScheduler.void runSafely(kotlinx.coroutines.scheduling.Task)(CoroutineScheduler.java:0)
kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.void executeTask(kotlinx.coroutines.scheduling.Task)(CoroutineScheduler.java:0)
kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.void runWorker()(CoroutineScheduler.java:0)
kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.void run()(CoroutineScheduler.java:0)

@williamlee1982 尝试修复了,试试更新一下: https://www.pgyer.com/picquery

在v1.1.2中应当已经修复。