android - Picasso fails to decode some images: skia decode returned false -
update: seems question boils down images correctly decoded, while don't. if convert non-working jpeg
s png
s, work. none of images taken directly jpeg
s either nikon d5000
, panasonic lumix
or sony experia
phone can decoded.
i using picasso
fill listview
in android
app. am, however, running error --- decoder->decode returned false
images use, works fine other pictures run across around web. therefore, believe has images, not sure. error arises in skia
library used picasso
(as far know).
for example, this image works fine, while this not, , latter need work. other pictures need use taken same camera , edited gimp
in same way, resulting in images first one, none of them work. hence, suspect has images rather decoder.
a few questions pops up:
- is possible metadata can in process? metadata similar in pictures.
- could encoded images makes encoder go crazy? if so, , how can investigate it? end of file missing or anything?
- is possible enable more debugging , output
picasso
orskia
? stack traces, example? - will non-utf8 characters mess things up, or handled correctly? example image not have utf8 characters in it, of images may have.
what have tried:
- i tried opening non-working image in
inkscape
, exportingpng
file instead. now, image works, there seemsjpeg
encoding. - another try open image in
gimp
, exportingjpeg
again, did not help. - i tried opening image in
shotwell
, re-exportingjpeg
, both , without metadata, none of these images work. exportingpng
works exportingpng
inkscape
. - all non-working images taken
nikon d5000
camera, tried taking few imagessony experia
phone ,panasonic lumix
camera. non ofjpeg
s work directly, if convertedpng
decoded. - i tried setting
picasso.builder
object shown here, stack trace. have pasted stack trace below. might seemandroid.bitmapfactory.decodestream()
fails, stack trace pointscom.squareup.picasso.bitmaphunter.decodestream()
, utilizesandroid.bitmapfactory.decodestream()
. maybe error has nothingskia
after all. - i used
imagemagick
'sidentify -verbose
on working , non-working images , compared outputs. unable find differences stood out, did not bring me further.
example logcat output:
d/picasso(528): main created [r0] request{http://www.miasmat.no/wp-content/uploads/2015/05/ovnsbaktkveite9.jpg} d/picasso(528): dispatcher enqueued [r0]+7ms d/picasso(528): main created [r1] request{http://www.miasmat.no/wp-content/uploads/2015/05/ovnsbaktkveite9.jpg} d/picasso(528): hunter joined [r1]+1ms [r0]+10ms, [r1]+1ms d/picasso(528): main created [r2] request{http://www.miasmat.no/wp-content/uploads/2015/05/ovnsbaktkveite9.jpg} d/picasso(528): hunter joined [r2]+1ms [r0]+14ms, [r1]+5ms, [r2]+2ms d/picasso(528): hunter executing [r0]+21ms, [r1]+12ms, [r2]+9ms d/skia(528): --- decoder->decode returned false d/picasso(528): dispatcher retrying [r0]+1456ms, [r1]+1447ms, [r2]+1444ms d/picasso(528): hunter executing [r0]+1458ms, [r1]+1448ms, [r2]+1445ms d/skia(528): --- decoder->decode returned false d/picasso(528): dispatcher retrying [r0]+2867ms, [r1]+2857ms, [r2]+2854ms d/picasso(528): hunter executing [r0]+2868ms, [r1]+2859ms, [r2]+2855ms d/skia(528): --- decoder->decode returned false d/picasso(528): dispatcher batched [r0]+3406ms, [r1]+3397ms, [r2]+3394ms error d/dalvikvm(249): gc_explicit freed 119 objects / 5288 bytes in 28ms i/tagz(528): error! url = http://www.miasmat.no/wp-content/uploads/2015/05/ovnsbaktkveite9.jpg d/picasso(528): main errored [r0]+3607ms i/tagz(528): error! url = http://www.miasmat.no/wp-content/uploads/2015/05/ovnsbaktkveite9.jpg d/picasso(528): main errored [r1]+3598ms i/tagz(528): error! url = http://www.miasmat.no/wp-content/uploads/2015/05/ovnsbaktkveite9.jpg d/picasso(528): main errored [r2]+3596ms d/picasso(528): dispatcher delivered [r0]+3610ms, [r1]+3601ms, [r2]+3598ms
stack trace picasso
, pointing this file.
w/system.err(1467): java.io.ioexception: failed decode stream. w/system.err(1467): @ com.squareup.picasso.bitmaphunter.decodestream(bitmaphunter.java:145) w/system.err(1467): @ com.squareup.picasso.bitmaphunter.hunt(bitmaphunter.java:217) w/system.err(1467): @ com.squareup.picasso.bitmaphunter.run(bitmaphunter.java:159) w/system.err(1467): @ java.util.concurrent.executors$runnableadapter.call(executors.java:441) w/system.err(1467): @ java.util.concurrent.futuretask$sync.innerrun(futuretask.java:305) w/system.err(1467): @ java.util.concurrent.futuretask.run(futuretask.java:137) w/system.err(1467): @ java.util.concurrent.threadpoolexecutor.runworker(threadpoolexecutor.java:1068) w/system.err(1467): @ java.util.concurrent.threadpoolexecutor$worker.run(threadpoolexecutor.java:561) w/system.err(1467): @ java.lang.thread.run(thread.java:1096) w/system.err(1467): @ com.squareup.picasso.utils$picassothread.run(utils.java:411)
getview
method in baseadapter
listview
:
@override public view getview(int position, view convertview, viewgroup parent) { final view view; recipe recipe = this.getitem(position); if (convertview != null){ view = convertview; view.settag(recipe.getid()); } else{ view = myactivity.getlayoutinflater().inflate(r.layout.recipe_item, parent, false); view.settag(recipe.getid()); } imageview imageview = (imageview) view.findviewbyid(r.id.filtered_recipes_list_image_view); // final string foo = "https://cms-assets.tutsplus.com/uploads/users/21/posts/19431/featured_image/codefeature.jpg"; final string foo = "http://www.miasmat.no/wp-content/uploads/2015/05/ovnsbaktkveite9.jpg"; picasso.with(myactivity).setindicatorsenabled(true); picasso.with(myactivity).setloggingenabled(true); picasso.with(myactivity).load(foo).into(imageview, new callback() { @override public void onsuccess() { log.i("tagz", "success! url = " + foo); } @override public void onerror() { log.i("tagz", "error! url = " + foo); } }); return view; }
reason error is: trying set image of size more image view layout size.
i found simple solution that! if using picasso library image loading..then, resize image fir image view layout.
i.e, have done this:
picasso.with(imageloaderactivity.this) .load("https://static.pexels.com/photos/34578/pexels-photo.jpg") .resize(200,250) .into(img);
Comments
Post a Comment