I am using Nostra's Universal Image Loader to display images. Here is the url of image I want to display:
http://hitbullseye.com/ATTACHMENT/test6eac134c-81ae-4a47-ba28-f25dcc48718a.jpg
I am getting the following error in logcat:
One thing I don't understand is why UIL is appending _480x800 at end of the url. I checked the image and its dimensions are 248x72. Here is my code:
My application class in which I created the config:
public class BullsEyeApplicationGlobal extends Application {
@Override
public void onCreate() {
super.onCreate();
File cacheDir = StorageUtils.getCacheDirectory(getApplicationContext());
ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(
getApplicationContext())
.taskExecutor(null)
.taskExecutorForCachedImages(null)
.threadPoolSize(3)
// default
.threadPriority(Thread.NORM_PRIORITY - 1)
// default
.tasksProcessingOrder(QueueProcessingType.FIFO)
// default
.denyCacheImageMultipleSizesInMemory()
.memoryCache(new LruMemoryCache(2 * 1024 * 1024))
// default
.discCache(new UnlimitedDiscCache(cacheDir))
.imageDownloader(
new BaseImageDownloader(getApplicationContext())) // default
.imageDecoder(new BaseImageDecoder(false)) // default
.defaultDisplayImageOptions(DisplayImageOptions.createSimple()) //
.writeDebugLogs().build();
ImageLoader.getInstance().init(config);
}
}
Here is where I am loading the image:
ImageLoader imgL = ImageLoader.getInstance();
DisplayImageOptions options = new DisplayImageOptions.Builder()
.resetViewBeforeLoading(false) // default
.cacheInMemory(true) // default
.cacheOnDisc(true) // default
.considerExifParams(false) // default
.imageScaleType(ImageScaleType.IN_SAMPLE_POWER_OF_2) // default
.bitmapConfig(Bitmap.Config.ARGB_8888) // default
.build();
ImageView imgg = (ImageView) v1.findViewById(R.id.test_image);
imgL.displayImage(js.getString("TestImage"), imgg, options);
It was not the problem of library. The problem was the images are CMYK - 8bit/channel - jpg files. They should be RGB - 16 bit/channel - png files to make them work across all devices. So, the problem was in image. My issue is resolved now, hope it help others!