【问题标题】:ios SdWebImage image wont display when resize image using Thumbor third partyios SdWebImage图像在使用Thumbor第三方调整图像大小时不会显示
【发布时间】:2015-10-29 16:36:22
【问题描述】:

我正在使用 SdWebImage 在 ImageView 中显示图像如果我直接使用图像 URL,如 http://52.74.11.56/photos/2015/07/1438154558488.jpg ,SDWebImage 工作完美。

但我需要使用Thumbor 作为缩略图服务。但是通过使用如下所示的拇指 URL

        str_thumb_URL0 =@"http://thumb.dot-share.com/unsafe/1024x556/smart/http://52.74.11.56/photos/2015/07/1438154558488.jpg";
        [cell.imageView sd_setImageWithURL:[NSURL URLWithString:str_thumb_URL0]
                          placeholderImage:[UIImage imageNamed:@"placeholder.png"]
                                 completed:^(UIImage image, NSError error, SDImageCacheType cacheType, NSURL *imageURL) {                                    
                                     NSLog(@"%@",error);
                                 }];

Xcode 产生这个错误

"Error Domain=SDWebImageErrorDomain Code=0 "下载的图片有 0 像素”用户信息=0x7f8e35477360 {NSLocalizedDescription=已下载 图像有 0 像素}"

注意:除了SdWebImage

,上面的Thumbor URL 可以在大多数其他WebImage 库中使用

请帮我解决这个问题

【问题讨论】:

    标签: ios iphone resize sdwebimage thumbor


    【解决方案1】:

    问题在于图像 URL 的服务器主机名。

    解决办法是:-

    你可以用一个简单的命令来解决这个问题:

    回显“127.0.0.1 $HOSTNAME”| sudo tee -a /etc/hosts

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-08-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-03-27
      相关资源
      最近更新 更多