我无法在Universal Image Loader中加载大图像。
我的代码
ImageLoader imageLoader = null;
try {
File cacheDir = StorageUtils.getOwnCacheDirectory(this, Environment
.getExternalStorageDirectory().getAbsolutePath());
DisplayImageOptions defaultOptions = new DisplayImageOptions.Builder()
.cacheOnDisc().imageScaleType(ImageScaleType.EXACTLY)
.bitmapConfig(Bitmap.Config.RGB_565).build();
ImageLoaderConfiguration.Builder builder = new ImageLoaderConfiguration.Builder(
this).defaultDisplayImageOptions(defaultOptions)
.discCache(new UnlimitedDiscCache(cacheDir))
.memoryCache(new WeakMemoryCache());
ImageLoaderConfiguration config = builder.build();
imageLoader = ImageLoader.getInstance();
imageLoader.init(config);
} catch (Exception e) {
e.printStackTrace();
}
ImageView imageView1 = (ImageView) findViewById(R.id.imageView1);
imageLoader
.displayImage(
"http://www.kenrockwell.com/canon/lenses/images/100mm/IMG_1906.JPG",
imageView1, new ImageLoadingListener() {
@Override
public void onLoadingStarted(String arg0, View arg1) {
// TODO Auto-generated method stub
}
@Override
public void onLoadingFailed(String arg0, View arg1,
FailReason arg2) {
Log.e("", "" + arg2);
}
@Override
public void onLoadingComplete(String arg0,
View arg1, Bitmap arg2) {
}
@Override
public void onLoadingCancelled(String arg0,
View arg1) {
}
});
我收到这样的错误
09-27 14:13:00.982: E/ImageLoader(31251): Image can't be decoded [http://www.kenrockwell.com/canon/lenses/images/100mm/IMG_1906.JPG_1080x1920]
我能够加载其他图像只有这个图像不能加载。可能它的大小超过 5 MB。那么如何使用 UIL 加载大图像。有没有其他方法可以解决这个问题?