Android-Universal-Image-Loader icon indicating copy to clipboard operation
Android-Universal-Image-Loader copied to clipboard

ImageLoader: Image can't be decoded while making thumbnails of videos

Open hasnain-ahmad opened this issue 9 years ago • 1 comments

I am using universal-image-loader-1.9.5. I am using UIL to get thumbnails of videos for my gallery app. Here is my UIL DisplayImageOptions and ImageLoaderConfiguration code.

DisplayImageOptions defaultOptions = new DisplayImageOptions.Builder()
.cacheInMemory(true)
.cacheOnDisk(true)
.imageScaleType(ImageScaleType.EXACTLY)
.showImageOnFail(R.drawable.waring_shield_icon)
.bitmapConfig(Bitmap.Config.ARGB_8888)
.build();

ImageLoaderConfiguration.Builder builder = new ImageLoaderConfiguration.Builder(this).threadPriority(Thread.NORM_PRIORITY - 2)
.denyCacheImageMultipleSizesInMemory()
.tasksProcessingOrder(QueueProcessingType.FIFO)
.defaultDisplayImageOptions(defaultOptions)
.diskCacheFileNameGenerator(new Md5FileNameGenerator())
.imageDecoder(new BaseImageDecoder(true))
.memoryCache(new WeakMemoryCache());

ImageLoader.getInstance().init(builder.build());

Here is the error stack

06-29 17:23:20.461 17073-18821/com.example. E/ImageLoader: Image can't be decoded [file:///storage/extSdCard/2015 HD/Aankhon Aankhon (Bhaag Johnny) HD(wapking.cc).mp4_720x1280]
06-29 17:27:35.661 17073-18820/com.example. E/ImageLoader: Image can't be decoded [file:///storage/extSdCard/Lokle hd song/akhia no akhia.mp4_720x1280]

I have remove the %20 from the path but still I am getting the above error, decoding path using below code.

Uri uri = Uri.fromFile(new File(specificFolderList.get(position).getData()));
String strUri = uri.toString();
strUri = Uri.decode(strUri);
imageLoader.loadImage(strUri, new SimpleImageLoadingListener() {
    @Override
    public void onLoadingComplete(String imageUri, View view, Bitmap loadedImage) {
              loadedImage = BitmapDecoder.from(loadedImage)
                .scale(dp2px(100), dp2px(100))
                .decode();
               viewHolder.ivThumbnail.setImageBitmap(loadedImage);
    }
    @Override
    public void onLoadingFailed(String imageUri, View view, FailReason failReason) {
        super.onLoadingFailed(imageUri, view, failReason);
        viewHolder.ivThumbnail.setImageResource(R.drawable.waring_shield_icon);
           }
});

Here is the files full path.

/storage/extSdCard/2015 HD/Aankhon Aankhon (Bhaag Johnny) HD(wapking.cc).mp4
/storage/extSdCard/Lokle hd song/akhia no akhia.mp4

hasnain-ahmad avatar Jun 30 '16 19:06 hasnain-ahmad

did you already solve the problem?I face it too

4sskick avatar Aug 20 '19 12:08 4sskick