We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
在YBIBDefaultWebImageMediator.m头部导入#import "UIImage+MultiFormat.h" 把方法yb_downloadImageWithURL修改一下
(id)yb_downloadImageWithURL:(NSURL *)URL requestModifier:(nullable YBIBWebImageRequestModifierBlock)requestModifier progress:(nonnull YBIBWebImageProgressBlock)progress success:(nonnull YBIBWebImageSuccessBlock)success failed:(nonnull YBIBWebImageFailedBlock)failed { if (!URL) return nil;
SDWebImageDownloadToken *token = [[SDWebImageDownloader sharedDownloader] downloadImageWithURL:URL options:SDWebImageDownloaderLowPriority progress:^(NSInteger receivedSize, NSInteger expectedSize, NSURL * _Nullable targetURL) { if (progress) progress(receivedSize, expectedSize); } completed:^(UIImage * _Nullable image, NSData * _Nullable data, NSError * _Nullable error, BOOL finished) {
if (error) { if (failed) failed(error, finished); } else { SDImageFormat imgFType= [NSData sd_imageFormatForImageData:data]; if (imgFType == SDImageFormatUndefined || imgFType == SDImageFormatWebP) {//处理webP图片不能显示的情况 data = UIImageJPEGRepresentation(image, 1); } if (success) success(data, finished); } }]; return token;
}
主要是webp图片请求成功,但是YBIBImageData 的loadURL_download方法转换失败导致 所以在yb_downloadImageWithURL添加了webP图片的处理代码 SDImageFormat imgFType= [NSData sd_imageFormatForImageData:data]; if (imgFType == SDImageFormatUndefined || imgFType == SDImageFormatWebP) {//处理webP图片不能显示的情况 data = UIImageJPEGRepresentation(image, 1); }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
在YBIBDefaultWebImageMediator.m头部导入#import "UIImage+MultiFormat.h"
把方法yb_downloadImageWithURL修改一下
(id)yb_downloadImageWithURL:(NSURL *)URL requestModifier:(nullable YBIBWebImageRequestModifierBlock)requestModifier progress:(nonnull YBIBWebImageProgressBlock)progress success:(nonnull YBIBWebImageSuccessBlock)success failed:(nonnull YBIBWebImageFailedBlock)failed {
if (!URL) return nil;
SDWebImageDownloadToken *token = [[SDWebImageDownloader sharedDownloader] downloadImageWithURL:URL options:SDWebImageDownloaderLowPriority progress:^(NSInteger receivedSize, NSInteger expectedSize, NSURL * _Nullable targetURL) {
if (progress) progress(receivedSize, expectedSize);
} completed:^(UIImage * _Nullable image, NSData * _Nullable data, NSError * _Nullable error, BOOL finished) {
if (error) {
if (failed) failed(error, finished);
} else {
SDImageFormat imgFType= [NSData sd_imageFormatForImageData:data];
if (imgFType == SDImageFormatUndefined || imgFType == SDImageFormatWebP) {//处理webP图片不能显示的情况
data = UIImageJPEGRepresentation(image, 1);
}
if (success) success(data, finished);
}
}];
return token;
}
主要是webp图片请求成功,但是YBIBImageData 的loadURL_download方法转换失败导致
所以在yb_downloadImageWithURL添加了webP图片的处理代码
SDImageFormat imgFType= [NSData sd_imageFormatForImageData:data];
if (imgFType == SDImageFormatUndefined || imgFType == SDImageFormatWebP) {//处理webP图片不能显示的情况
data = UIImageJPEGRepresentation(image, 1);
}
The text was updated successfully, but these errors were encountered: