Fix the edge case when incrementalDecodedImageWithOptions provide custom scale factor and override the one from init method
This commit is contained in:
parent
c9dffc64dc
commit
ec620438b9
|
@ -339,7 +339,12 @@
|
|||
|
||||
if (_width + _height > 0) {
|
||||
// Create the image
|
||||
image = [SDImageIOAnimatedCoder createFrameAtIndex:0 source:_imageSource scale:_scale preserveAspectRatio:_preserveAspectRatio thumbnailSize:_thumbnailSize];
|
||||
CGFloat scale = _scale;
|
||||
NSNumber *scaleFactor = options[SDImageCoderDecodeScaleFactor];
|
||||
if (scaleFactor != nil) {
|
||||
scale = MAX([scaleFactor doubleValue], 1);
|
||||
}
|
||||
image = [SDImageIOAnimatedCoder createFrameAtIndex:0 source:_imageSource scale:scale preserveAspectRatio:_preserveAspectRatio thumbnailSize:_thumbnailSize];
|
||||
if (image) {
|
||||
image.sd_imageFormat = self.class.imageFormat;
|
||||
}
|
||||
|
|
|
@ -185,7 +185,12 @@
|
|||
|
||||
if (_width + _height > 0) {
|
||||
// Create the image
|
||||
image = [SDImageIOAnimatedCoder createFrameAtIndex:0 source:_imageSource scale:_scale preserveAspectRatio:_preserveAspectRatio thumbnailSize:_thumbnailSize];
|
||||
CGFloat scale = _scale;
|
||||
NSNumber *scaleFactor = options[SDImageCoderDecodeScaleFactor];
|
||||
if (scaleFactor != nil) {
|
||||
scale = MAX([scaleFactor doubleValue], 1);
|
||||
}
|
||||
image = [SDImageIOAnimatedCoder createFrameAtIndex:0 source:_imageSource scale:scale preserveAspectRatio:_preserveAspectRatio thumbnailSize:_thumbnailSize];
|
||||
if (image) {
|
||||
CFStringRef uttype = CGImageSourceGetType(_imageSource);
|
||||
image.sd_imageFormat = [NSData sd_imageFormatFromUTType:uttype];
|
||||
|
|
Loading…
Reference in New Issue