Android Picasso Image无法加载 [英] Android Picasso Image does not load

查看:459
本文介绍了Android Picasso Image无法加载的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有两种情况我加载图像,第一种是直接从互联网上加载,第二种是加载在设备中下载的图像。每当我加载时,显示10个图像中的8~9个,并且1-2个丢失。我看到解码返回false,并尽可能地坚持google,但无法提出。

There are two situations I load images, first, just directly from the internet, and second, load images that are downloaded in the device. And whenever I load, 8~9 out of 10 images are shown, and 1-2 missing. I see that decode returned false, and google'd as hard as I can, but couldn't come up.



  1. WAIT_FOR_CONCURRENT_GC阻止22ms

  2. WAIT_FOR_CONCURRENT_GC阻止20ms

  3. GC_FOR_ALLOC释放718K,31%免费9948K / 14256K,暂停49ms,总计51ms

  4. D / skia:--- decoder-> decode返回falseGC_CONCURRENT释放1370K, 30%免费10081K / 14256K,暂停3ms + 2ms,总计33ms

  5. GC_FOR_ALLOC释放916K,30%免费10029K / 14256K,暂停66ms,总计67ms

  1. WAIT_FOR_CONCURRENT_GC blocked 22ms
  2. WAIT_FOR_CONCURRENT_GC blocked 20ms
  3. GC_FOR_ALLOC freed 718K, 31% free 9948K/14256K, paused 49ms, total 51ms
  4. D/skia: --- decoder->decode returned falseGC_CONCURRENT freed 1370K, 30% free 10081K/14256K, paused 3ms+2ms, total 33ms
  5. GC_FOR_ALLOC freed 916K, 30% free 10029K/14256K, paused 66ms, total 67ms


这是我用来加载Picasso的代码:

Here's code I use to load through Picasso:

        Picasso.with(activity)
            .load(path)
            .placeholder(R.drawable.thumbnail_placeholder)
            .resize(width,height)
            .into(imageView);

任何想法如何解决这个问题?我每次在屏幕上加载图像时都会调用fit()/ resize()。非常感谢,提前感谢!

Any ideas how to solve this issue? I am calling fit()/resize() every time I get the images to load on the screen. Help much appreciated, thanks in advance!

仅供参考,我在两台机器,模拟器和真实设备上测试三星Galaxy Tab 3,并且在模拟器上没有任何问题,但在真实设备上会出现问题。

FYI, I test on both machines, emulator and the real device, Samsung Galaxy Tab 3, and works without any problems on emulator, but problems occur on real device.

更新:

它是由图像的色彩空间引起的,其中图像是没有出现在YMCK色彩空间的那些。

It was causing by image's color space, where images that weren't showing up were the ones that were in YMCK color space.

推荐答案

您可以使用 Picasso.with(上下文)启用Picasso日志.setLoggingEnabled(true)。您可能会看到一条错误消息,其中有一个原因。

You can turn on Picasso logs using Picasso.with(Context).setLoggingEnabled(true). You will probably see an error message with a reason there.

为了以防万一,还需要记录您正在使用的URL并尝试使用浏览器。

It's also worth logging the URL you are using and trying it a browser, just in case.

这篇关于Android Picasso Image无法加载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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