【发布时间】:2013-08-03 11:11:36
【问题描述】:
我正在使用SDWebImage 在我的 iOS 应用中加载图像,现在我想使用 webp 格式。
这是我的第一次尝试:
NSURL *url = [NSURL URLWithString:@"http://www.gstatic.com/webp/gallery/2.webp"];
[self.imageView setImageWithURL:url
placeholderImage:nil
options:SDWebImageProgressiveDownload
completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType) {
if (error) {
UIAlertView *av = [[UIAlertView alloc] initWithTitle:@"Error" message:error.localizedDescription delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
[av show];
}
}];
如果图像是 jpeg(我尝试过),它会完美运行,但使用 webp 则不会。 我第一次调用此代码时,错误是:
Downloaded image has 0 pixels
然后错误转为:
The operation couldn't be completed. (NSURLErrorDomain error -1100.)
怎么了?
【问题讨论】:
标签: ios sdwebimage webp