更改服务器图片尺寸
来源:互联网 发布:python的print不换行 编辑:程序博客网 时间:2024/06/12 18:08
if (json[@"banners"]) {
NSArray *images = [WKParserUtil array:json key:@"banners"];
[newObject createAttribute:@"banners" data:images];
}
if (json[@"productimgs"]) {
NSArray *images = [WKParserUtil array:json key:@"productimgs"];
NSMutableArray *productImages = [NSMutableArray arrayWithCapacity:images.count];
[images enumerateObjectsUsingBlock:^(id _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
NSMutableDictionary *dic = [NSMutableDictionary dictionaryWithCapacity:images.count];
if ([UIScreen mainScreen].scale == 2.f ) {
dic[@"height"] = @([obj[@"img_height"] floatValue]/2);
}else if ([UIScreen mainScreen].scale == 3.f )
{
dic[@"height"] = @([obj[@"img_height"] floatValue]/3);
}
dic[@"wight"] = obj[@"img_width"];
NSString *imageUrl = [LEJAppUtil spliceSouurceUrlBySize:CGSizeMake(SCREEN_WIDTH, [obj[@"img_height"] floatValue]) url:obj[@"imgurl"]];
dic[@"imageUrl"] = imageUrl;
[productImages addObject:dic];
}];
[newObject createAttribute:@"productImages" data:productImages];
}
NSArray *images = [WKParserUtil array:json key:@"banners"];
[newObject createAttribute:@"banners" data:images];
}
if (json[@"productimgs"]) {
NSArray *images = [WKParserUtil array:json key:@"productimgs"];
NSMutableArray *productImages = [NSMutableArray arrayWithCapacity:images.count];
[images enumerateObjectsUsingBlock:^(id _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
NSMutableDictionary *dic = [NSMutableDictionary dictionaryWithCapacity:images.count];
if ([UIScreen mainScreen].scale == 2.f ) {
dic[@"height"] = @([obj[@"img_height"] floatValue]/2);
}else if ([UIScreen mainScreen].scale == 3.f )
{
dic[@"height"] = @([obj[@"img_height"] floatValue]/3);
}
dic[@"wight"] = obj[@"img_width"];
NSString *imageUrl = [LEJAppUtil spliceSouurceUrlBySize:CGSizeMake(SCREEN_WIDTH, [obj[@"img_height"] floatValue]) url:obj[@"imgurl"]];
dic[@"imageUrl"] = imageUrl;
[productImages addObject:dic];
}];
[newObject createAttribute:@"productImages" data:productImages];
}
0 0
- 更改服务器图片尺寸
- matlab更改图片尺寸
- Photoshop 脚本 - 批量更改图片尺寸
- photoshop脚本:批量更改图片尺寸的脚本
- Matlab 文件夹遍历并更改图片尺寸
- 图片尺寸
- MWPhotoBrowser的基本使用及图片尺寸的更改
- 更改SQLServer服务器时间
- 更改sps2003服务器名
- 如何更改服务器名称
- asterisk 更改服务器名称
- linux 更改服务器时间
- svn服务器地址更改
- windows服务器密码更改
- 更改数据库服务器名称
- svn服务器地址更改 .
- Web服务器更改
- git 更改服务器地址
- javase重新开始系列之JDBC
- douco模板理解
- Maple数据分析 级数与拟合
- Java Script-错误
- iOS开发-UIView之动画效果的实现方法(合集)
- 更改服务器图片尺寸
- s3c2440 uda1341声卡驱动与madplay播放器移植
- Codeforces Round #367 (Div. 2) B. Interesting drink (二分)
- qq邮箱发邮件
- Android进程间通讯之AIDL
- LCS算法
- JQuery(入门一)
- VS2015卸载与系统盘扩展
- httpclient访问https网站失败(peer not authenticated)