从资产不加载图像文件夹使用通用图像装载机 [英] Images not loading from assets folder using Universal Image Loader

查看:121
本文介绍了从资产不加载图像文件夹使用通用图像装载机的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我做的正是<一href="http://stackoverflow.com/questions/16679639/universal-image-loader-throws-unsupportedoperationexception-not-sure-why">this小伙表明这是完全一样的通用图像装载机的创造者,但我仍然得到这个错误:

I do exactly what this guy suggests which is exactly the same as the creator of the Universal Image Loader, but I still get this error:

URI = assets://NMF0002_007.jpg
resolveUri failed on bad bitmap uri: NMF0002_007.jpg

我应该怎么寻找,以确保图像识别?

What should I look for to ensure that the images are recognised?

我用这样的:

//get the file name
String fileName = cursor.getString(cursor.getColumnIndexOrThrow(DatabaseHelper.FIELD_RESOURCE));
String imageUri = "assets://";
Log.d(TAG, "URI = " + imageUri + fileName);
ImageLoader.getInstance().displayImage(imageUri+fileName, holder.iv_details_resource);

这是我的配置:

//Get the imageloader.
ImageLoader imageLoader = ImageLoader.getInstance();

//Create image options.
DisplayImageOptions options = new DisplayImageOptions.Builder()
    .cacheOnDisc() 
    .imageScaleType(ImageScaleType.IN_SAMPLE_POWER_OF_2) 
    .bitmapConfig(Bitmap.Config.RGB_565)
    .build();

//Create a config with those options.
ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(getApplicationContext())
    .defaultDisplayImageOptions(options)
    .discCacheExtraOptions(480, 800, CompressFormat.JPEG, 75)
    .build();

//Initialise the imageloader.
imageLoader.init(config);

我在做什么错误或丢失?

What am I doing wrong or missing?

推荐答案

解决方案 - 我一直在寻找的jpg和我的文件扩展名是.JPG

Solution - I was looking for .jpg and my file extension was .JPG

如果NOSTRA可以张贴一些聪明的事情是在寻找我会标出你的答案,我的愚蠢作出正式答复。

If NOSTRA can post some clever things to be on the lookout for I'll mark your answer as an official answer to my silliness.

这篇关于从资产不加载图像文件夹使用通用图像装载机的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆