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

Error when loading some images (decoder->decode returned false)

Open KSergiy opened this issue 13 years ago • 7 comments

Hi! Thanks for your good library! I have some problem. My app works with many pictures which loading from network! 98% loading god, but some pics dont loading, and showing errors:

02-05 16:47:02.459: D/ImageLoader(14105): Original image (291x300) is going to be subsampled to 162x160 view. Computed scale size - 1
02-05 16:47:02.519: D/dalvikvm(14105): GC_FOR_ALLOC freed 2331K, 22% free 16457K/21027K, paused 35ms
02-05 16:47:02.529: D/skia(14105): --- decoder->decode returned false
02-05 16:47:02.549: E/ImageLoader(14105): null
02-05 16:47:02.549: E/ImageLoader(14105): java.lang.NullPointerException
02-05 16:47:02.549: E/ImageLoader(14105):   at com.universalimageloader.core.LoadAndDisplayImageTask.saveImageOnDisc(LoadAndDisplayImageTask.java:289)
02-05 16:47:02.549: E/ImageLoader(14105):   at com.universalimageloader.core.LoadAndDisplayImageTask.tryLoadBitmap(LoadAndDisplayImageTask.java:204)
02-05 16:47:02.549: E/ImageLoader(14105):   at com.universalimageloader.core.LoadAndDisplayImageTask.run(LoadAndDisplayImageTask.java:128)
02-05 16:47:02.549: E/ImageLoader(14105):   at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:442)
02-05 16:47:02.549: E/ImageLoader(14105):   at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
02-05 16:47:02.549: E/ImageLoader(14105):   at java.util.concurrent.FutureTask.run(FutureTask.java:137)
02-05 16:47:02.549: E/ImageLoader(14105):   at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
02-05 16:47:02.549: E/ImageLoader(14105):   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
02-05 16:47:02.549: E/ImageLoader(14105):   at java.lang.Thread.run(Thread.java:856)

KSergiy avatar Feb 05 '13 14:02 KSergiy

Read it please - https://github.com/nostra13/Android-Universal-Image-Loader#user-support

nostra13 avatar Feb 05 '13 20:02 nostra13

I read and check different variants! In result i have grid - gallery! And it works perfectly! But now adding two pics, which don't show with that error! I think it problem with weight of pics, but when try make it smaller - not help! Now i think that problem with sizes!. How i say i load more than 300 pics and problem now just with 2 pics, other showing correctly!

My current config:

mageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(a)
            .memoryCacheExtraOptions(w, h) // width / 2 & height / 5 display 
            .discCacheExtraOptions(w, h, CompressFormat.PNG, 30)
            .threadPoolSize(2) // default
            .threadPriority(Thread.MIN_PRIORITY + 2) // default
            .memoryCacheSize(60 * 1024 * 1024)
            .denyCacheImageMultipleSizesInMemory()
            .discCache(new UnlimitedDiscCache(cacheDir)) // default
            .discCacheFileNameGenerator(new HashCodeFileNameGenerator()) // default
            .build(); 
options = new DisplayImageOptions.Builder()
                .showStubImage(R.drawable.loader)
                .showImageForEmptyUri(R.drawable.loader)
                .cacheInMemory()
                .cacheOnDisc()
                .delayBeforeLoading(0)
                .imageScaleType(ImageScaleType.EXACTLY)
                .build();

KSergiy avatar Feb 06 '13 18:02 KSergiy

Can you write URLs of these images which are failed to load?

nostra13 avatar Feb 06 '13 19:02 nostra13

http://images.oldtimewallpapers.com/wallpapers/201212/87c6353cea53e7ff07d641f8bb71db67_medium.jpg http://images.oldtimewallpapers.com/wallpapers/201302/22074ac8209f1954e55c4b099a7515fc_medium.jpg

or

http://images.oldtimewallpapers.com/wallpapers/201302/22074ac8209f1954e55c4b099a7515fc_prew.jpg http://images.oldtimewallpapers.com/wallpapers/201212/87c6353cea53e7ff07d641f8bb71db67_prew.jpg

KSergiy avatar Feb 07 '13 16:02 KSergiy

This is the problem of these images: they have some special format so Android decoder can't decode them. BitmapFactory.decodeStream(imageStream, null, decodeOptions); fails with --- decoder->decode returned false

So this is not a problem of UIL.

nostra13 avatar Feb 07 '13 20:02 nostra13

Some info about this problem: http://www.quora.com/Android-OS/Why-does-the-Android-SKIA-library-have-poor-JPEG-decoding-capabilities

nostra13 avatar Feb 14 '13 12:02 nostra13

@nostra13 please put the code for cmyk type of format image loading into UIL.

bhaveshrangani avatar Dec 29 '15 06:12 bhaveshrangani