Add limitBytes arg for UIImage+ForceDecode category
This commit is contained in:
parent
7272cf78e5
commit
fcfca57463
|
@ -31,4 +31,13 @@
|
||||||
*/
|
*/
|
||||||
+ (nullable UIImage *)sd_decodedAndScaledDownImageWithImage:(nullable UIImage *)image;
|
+ (nullable UIImage *)sd_decodedAndScaledDownImageWithImage:(nullable UIImage *)image;
|
||||||
|
|
||||||
|
/**
|
||||||
|
Decompress and scale down the provided image and limit bytes
|
||||||
|
|
||||||
|
@param image The image to be decompressed
|
||||||
|
@param bytes The limit bytes size. Provide 0 to use the build-in limit.
|
||||||
|
@return The decompressed and scaled down image
|
||||||
|
*/
|
||||||
|
+ (nullable UIImage *)sd_decodedAndScaledDownImageWithImage:(nullable UIImage *)image limitBytes:(NSUInteger)bytes;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
|
@ -29,10 +29,14 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (UIImage *)sd_decodedAndScaledDownImageWithImage:(UIImage *)image {
|
+ (UIImage *)sd_decodedAndScaledDownImageWithImage:(UIImage *)image {
|
||||||
|
return [self sd_decodedAndScaledDownImageWithImage:image limitBytes:0];
|
||||||
|
}
|
||||||
|
|
||||||
|
+ (UIImage *)sd_decodedAndScaledDownImageWithImage:(UIImage *)image limitBytes:(NSUInteger)bytes {
|
||||||
if (!image) {
|
if (!image) {
|
||||||
return nil;
|
return nil;
|
||||||
}
|
}
|
||||||
return [SDWebImageCoderHelper decodedAndScaledDownImageWithImage:image limitBytes:0];
|
return [SDWebImageCoderHelper decodedAndScaledDownImageWithImage:image limitBytes:bytes];
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
Loading…
Reference in New Issue