【问题标题】:AFImageRequestOperation returns image that not downloaded competelyAFImageRequestOperation 返回未完全下载的图像
【发布时间】:2012-11-05 02:16:03
【问题描述】:
+[AFImageRequestOperation imageRequestOperationWithRequest:
                                      imageProcessingBlock:
                                                   success:
                                                   failure:]

如果互联网速度慢,返回的图像(尤其是 PNG)没有完全下载并且失败块,在这种情况下,不会被调用。

如何检查图片是否正确下载?

编辑:无论您将拥有哪种类型的请求:图像、xml、json 或 http,文件下载都可能会失败。随着文件变大和互联网变慢,这种可能性也会增加。

【问题讨论】:

    标签: iphone objective-c ios cocoa-touch afnetworking


    【解决方案1】:

    在此问题中建立的部分解决方案:
    Catching error: Corrupt JPEG data: premature end of data segment
    Detect if PNG file is corrupted in Objective C

    所以,图片下载后,你可以检查它是否有正确的开始和结束字节。

    编辑:Here 是一种更灵活的解决方案。

    【讨论】:

      猜你喜欢
      • 2014-05-07
      • 1970-01-01
      • 2018-04-23
      • 2012-12-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-03-16
      相关资源
      最近更新 更多