Comments (3)
能不能把YYImage加载换成SD加载,YY没人维护了,...
from ybimagebrowser.
现在解决了吗?
from ybimagebrowser.
在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);
}
from ybimagebrowser.
Related Issues (20)
- 预览视频,下拉消失的时候,从手机屏幕边界回弹
- YBIBImageData.imageURL = [NSURL URLWithString:@"https://www.baidu.com/"]; 会崩溃
- 大神,大家需要你,出来维护吧
- 图片未加载完、视频等,下拉跳闪的解决办法
- 最新SDK,好像没有找到水印的功能
- 播放视频没声音
- 预览时,查看图片黑屏 HOT 3
- ios16上预览视频播放时左右滑动查看相邻的图片,再返回该视频后黑屏。iOS15没问题。 HOT 1
- Image对特大分辨率的渲染支持不太好。极容易因内存问题而crash。 HOT 1
- 什么时候支持 spm 呀? 本来想用 yb, 奈何不支持 spm
- 升级 sdwebimage 5.0 之后 找不到属性 YBImageBrowser shouldDecompressImages
- 崩溃
- 崩溃 HOT 5
- Xcode 15 iOS17 Crash HOT 3
- iOS 14 上的图片打开黑屏什么时候可以更新下 HOT 3
- ios17点击查看图片崩溃 HOT 2
- Can add apple privateInfo?
- 关于wepP图片不能显示,并把SDWebImage版本升级到4.7.0
- Use of undeclared identifier 'YBIBImageData'
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ybimagebrowser.