WindSekirun / NaraeImagePicker

MultiImagePicker for Android Application, written in Kotlin
Apache License 2.0
40 stars 14 forks source link

Cannot load .webp image in zoom view #10

Closed zeallat closed 5 years ago

zeallat commented 5 years ago
2018-12-05 10:29:32.440 2316-2316/com.ecubelabs.fm W/Glide: Load failed for /storage/emulated/0/Pictures/IMG_20181105_025024.webp with size [1080x1731]
    class com.bumptech.glide.load.engine.GlideException: Failed to load resource
    There were 3 causes:
    java.io.IOException(java.lang.RuntimeException: setDataSource failed: status = 0xFFFFFFEA)
    java.io.IOException(java.lang.RuntimeException: setDataSource failed: status = 0xFFFFFFEA)
    java.io.IOException(java.lang.RuntimeException: setDataSource failed: status = 0xFFFFFFEA)
     call GlideException#logRootCauses(String) for more detail
      Cause (1 of 3): class com.bumptech.glide.load.engine.GlideException: Failed LoadPath{FileInputStream->Object->Drawable}, LOCAL
        Cause (1 of 3): class com.bumptech.glide.load.engine.GlideException: Failed DecodePath{FileInputStream->GifDrawable->Drawable}
        Cause (2 of 3): class com.bumptech.glide.load.engine.GlideException: Failed DecodePath{FileInputStream->Bitmap->Drawable}
        Cause (3 of 3): class com.bumptech.glide.load.engine.GlideException: Failed DecodePath{FileInputStream->BitmapDrawable->Drawable}
      Cause (2 of 3): class com.bumptech.glide.load.engine.GlideException: Failed LoadPath{ParcelFileDescriptor->Object->Drawable}, LOCAL
    There were 2 causes:
    java.io.IOException(java.lang.RuntimeException: setDataSource failed: status = 0xFFFFFFEA)
    java.io.IOException(java.lang.RuntimeException: setDataSource failed: status = 0xFFFFFFEA)
     call GlideException#logRootCauses(String) for more detail
        Cause (1 of 2): class com.bumptech.glide.load.engine.GlideException: Failed DecodePath{ParcelFileDescriptor->Bitmap->Drawable}
    There was 1 cause:
    java.io.IOException(java.lang.RuntimeException: setDataSource failed: status = 0xFFFFFFEA)
     call GlideException#logRootCauses(String) for more detail
          Cause (1 of 1): class java.io.IOException: java.lang.RuntimeException: setDataSource failed: status = 0xFFFFFFEA
        Cause (2 of 2): class com.bumptech.glide.load.engine.GlideException: Failed DecodePath{ParcelFileDescriptor->BitmapDrawable->Drawable}
    There was 1 cause:
    java.io.IOException(java.lang.RuntimeException: setDataSource failed: status = 0xFFFFFFEA)
     call GlideException#logRootCauses(String) for more detail
          Cause (1 of 1): class java.io.IOException: java.lang.RuntimeException: setDataSource failed: status = 0xFFFFFFEA
      Cause (3 of 3): class com.bumptech.glide.load.engine.GlideException: Failed LoadPath{AssetFileDescriptor->Object->Drawable}, LOCAL
    There was 1 cause:
    java.io.IOException(java.lang.RuntimeException: setDataSource failed: status = 0xFFFFFFEA)
     call GlideException#logRootCauses(String) for more detail
        Cause (1 of 1): class com.bumptech.glide.load.engine.GlideException: Failed DecodePath{AssetFileDescriptor->Bitmap->Drawable}
    There was 1 cause:
    java.io.IOException(java.lang.RuntimeException: setDataSource failed: status = 0xFFFFFFEA)
     call GlideException#logRootCauses(String) for more detail
          Cause (1 of 1): class java.io.IOException: java.lang.RuntimeException: setDataSource failed: status = 0xFFFFFFEA
2018-12-05 10:29:32.442 2316-2316/com.ecubelabs.fm I/Glide: Root cause (1 of 3)
    java.io.IOException: java.lang.RuntimeException: setDataSource failed: status = 0xFFFFFFEA
        at com.bumptech.glide.load.resource.bitmap.VideoDecoder.decode(VideoDecoder.java:173)
        at com.bumptech.glide.load.engine.DecodePath.decodeResourceWithList(DecodePath.java:72)
        at com.bumptech.glide.load.engine.DecodePath.decodeResource(DecodePath.java:55)
        at com.bumptech.glide.load.engine.DecodePath.decode(DecodePath.java:45)
        at com.bumptech.glide.load.engine.LoadPath.loadWithExceptionList(LoadPath.java:58)
        at com.bumptech.glide.load.engine.LoadPath.load(LoadPath.java:43)
        at com.bumptech.glide.load.engine.DecodeJob.runLoadPath(DecodeJob.java:507)
        at com.bumptech.glide.load.engine.DecodeJob.decodeFromFetcher(DecodeJob.java:472)
        at com.bumptech.glide.load.engine.DecodeJob.decodeFromData(DecodeJob.java:458)
        at com.bumptech.glide.load.engine.DecodeJob.decodeFromRetrievedData(DecodeJob.java:410)
        at com.bumptech.glide.load.engine.DecodeJob.onDataFetcherReady(DecodeJob.java:379)
        at com.bumptech.glide.load.engine.SourceGenerator.onDataReady(SourceGenerator.java:112)
        at com.bumptech.glide.load.model.MultiModelLoader$MultiFetcher.onDataReady(MultiModelLoader.java:135)
        at com.bumptech.glide.load.data.LocalUriFetcher.loadData(LocalUriFetcher.java:52)
        at com.bumptech.glide.load.model.MultiModelLoader$MultiFetcher.loadData(MultiModelLoader.java:99)
        at com.bumptech.glide.load.engine.SourceGenerator.startNext(SourceGenerator.java:62)
        at com.bumptech.glide.load.engine.DecodeJob.runGenerators(DecodeJob.java:302)
        at com.bumptech.glide.load.engine.DecodeJob.decodeFromRetrievedData(DecodeJob.java:418)
        at com.bumptech.glide.load.engine.DecodeJob.onDataFetcherReady(DecodeJob.java:379)
        at com.bumptech.glide.load.engine.SourceGenerator.onDataReady(SourceGenerator.java:112)
        at com.bumptech.glide.load.model.MultiModelLoader$MultiFetcher.onDataReady(MultiModelLoader.java:135)
        at com.bumptech.glide.load.data.LocalUriFetcher.loadData(LocalUriFetcher.java:52)
        at com.bumptech.glide.load.model.MultiModelLoader$MultiFetcher.loadData(MultiModelLoader.java:99)
        at com.bumptech.glide.load.engine.SourceGenerator.startNext(SourceGenerator.java:62)
        at com.bumptech.glide.load.engine.DecodeJob.runGenerators(DecodeJob.java:302)
        at com.bumptech.glide.load.engine.DecodeJob.runWrapped(DecodeJob.java:272)
        at com.bumptech.glide.load.engine.DecodeJob.run(DecodeJob.java:233)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
        at java.lang.Thread.run(Thread.java:764)
        at com.bumptech.glide.load.engine.executor.GlideExecutor$DefaultThreadFactory$1.run(GlideExecutor.java:446)
     Caused by: java.lang.RuntimeException: setDataSource failed: status = 0xFFFFFFEA
        at android.media.MediaMetadataRetriever.setDataSource(Native Method)
        at android.media.MediaMetadataRetriever.setDataSource(MediaMetadataRetriever.java:139)
        at com.bumptech.glide.load.resource.bitmap.VideoDecoder$ParcelFileDescriptorInitializer.initialize(VideoDecoder.java:296)
        at com.bumptech.glide.load.resource.bitmap.VideoDecoder$ParcelFileDescriptorInitializer.initialize(VideoDecoder.java:291)
        at com.bumptech.glide.load.resource.bitmap.VideoDecoder.decode(VideoDecoder.java:161)
        at com.bumptech.glide.load.engine.DecodePath.decodeResourceWithList(DecodePath.java:72) 
        at com.bumptech.glide.load.engine.DecodePath.decodeResource(DecodePath.java:55) 
        at com.bumptech.glide.load.engine.DecodePath.decode(DecodePath.java:45) 
        at com.bumptech.glide.load.engine.LoadPath.loadWithExceptionList(LoadPath.java:58) 
        at com.bumptech.glide.load.engine.LoadPath.load(LoadPath.java:43) 
        at com.bumptech.glide.load.engine.DecodeJob.runLoadPath(DecodeJob.java:507) 
        at com.bumptech.glide.load.engine.DecodeJob.decodeFromFetcher(DecodeJob.java:472) 
        at com.bumptech.glide.load.engine.DecodeJob.decodeFromData(DecodeJob.java:458) 
        at com.bumptech.glide.load.engine.DecodeJob.decodeFromRetrievedData(DecodeJob.java:410) 
        at com.bumptech.glide.load.engine.DecodeJob.onDataFetcherReady(DecodeJob.java:379) 
        at com.bumptech.glide.load.engine.SourceGenerator.onDataReady(SourceGenerator.java:112) 
        at com.bumptech.glide.load.model.MultiModelLoader$MultiFetcher.onDataReady(MultiModelLoader.java:135) 
        at com.bumptech.glide.load.data.LocalUriFetcher.loadData(LocalUriFetcher.java:52) 
        at com.bumptech.glide.load.model.MultiModelLoader$MultiFetcher.loadData(MultiModelLoader.java:99) 
        at com.bumptech.glide.load.engine.SourceGenerator.startNext(SourceGenerator.java:62) 
        at com.bumptech.glide.load.engine.DecodeJob.runGenerators(DecodeJob.java:302) 
        at com.bumptech.glide.load.engine.DecodeJob.decodeFromRetrievedData(DecodeJob.java:418) 
        at com.bumptech.glide.load.engine.DecodeJob.onDataFetcherReady(DecodeJob.java:379) 
        at com.bumptech.glide.load.engine.SourceGenerator.onDataReady(SourceGenerator.java:112) 
        at com.bumptech.glide.load.model.MultiModelLoader$MultiFetcher.onDataReady(MultiModelLoader.java:135) 
        at com.bumptech.glide.load.data.LocalUriFetcher.loadData(LocalUriFetcher.java:52) 
        at com.bumptech.glide.load.model.MultiModelLoader$MultiFetcher.loadData(MultiModelLoader.java:99) 
        at com.bumptech.glide.load.engine.SourceGenerator.startNext(SourceGenerator.java:62) 
        at com.bumptech.glide.load.engine.DecodeJob.runGenerators(DecodeJob.java:302) 
        at com.bumptech.glide.load.engine.DecodeJob.runWrapped(DecodeJob.java:272) 
        at com.bumptech.glide.load.engine.DecodeJob.run(DecodeJob.java:233) 
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162) 
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636) 
        at java.lang.Thread.run(Thread.java:764) 
        at com.bumptech.glide.load.engine.executor.GlideExecutor$DefaultThreadFactory$1.run(GlideExecutor.java:446) 
WindSekirun commented 5 years ago

Edit: Fresco need initialize() in Application class, so i should check https://github.com/zjupure/GlideWebpDecoder

Currently, Glide doesn't support .webp extensions. ~we'll migrate to Fresco for support .webp extensions.~

Also, can you provide a sample image of .webp? (if that image is a private image, please send to my mail, pyxis@uzuki.live

Reference: https://github.com/bumptech/glide/issues/571

WindSekirun commented 5 years ago

Check your .webp image is working in zoom mode with this version. implementation 'com.github.WindSekirun:NaraeImagePicker:cf782651ac'

Let me know if any error has happened.

WindSekirun commented 5 years ago

Note for future: GlideWebpDecoder library use libwebp to decode webp image. so final apk size will increase about 788.2KB.

If you try to reduce final apk size, consider APK Split

zeallat commented 5 years ago

@WindSekirun Thanks for works. ClassCastException has occurred.

2018-12-05 15:11:53.335 10533-10533/com.ecubelabs.fm E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.ecubelabs.fm, PID: 10533
    java.lang.ClassCastException: com.ecubelabs.core.util.GlideRequests cannot be cast to pyxis.uzuki.live.naraeimagepicker.module.GlideRequests
        at pyxis.uzuki.live.naraeimagepicker.module.GlideApp.with(GlideApp.java:88)
        at pyxis.uzuki.live.naraeimagepicker.fragment.adapter.ImageAdapter$ListHolder.bind(ImageAdapter.kt:45)
        at pyxis.uzuki.live.naraeimagepicker.fragment.adapter.ImageAdapter.onBindViewHolder(ImageAdapter.kt:31)
        at pyxis.uzuki.live.naraeimagepicker.fragment.adapter.ImageAdapter.onBindViewHolder(ImageAdapter.kt:27)
        at androidx.recyclerview.widget.RecyclerView$Adapter.onBindViewHolder(RecyclerView.java:6781)
WindSekirun commented 5 years ago

This seems to be a problem with using the GlideModule in the subproject. Hold on for a minute, I'll publish a new snapshot build.

WindSekirun commented 5 years ago

Resolved on remove using AppGlideModule in library projects commit.

Snapshot will be available after 5 minutes.

 implementation 'com.github.WindSekirun:NaraeImagePicker:976c8dad19'
zeallat commented 5 years ago

skjdslkjdslkjfslkjsdl mm... I think .webp was supported correctly before. Maybe it was just image file was wrong...?

WindSekirun commented 5 years ago

Remain current implementation for future.

Released as 1.8.0. Thanks!