我正在使用SDWebImage在我的iOS应用程序中加载图像,现在我想使用webp格式。
以下是我的第一次尝试:
如果图像是jpeg格式(我尝试过),它将完美地工作,但是对于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.)
什么问题?