Fix the case that provided DPI cause `kCGImagePropertyPixelWidth` return non-zero value
This will cause re-check thumbnail, and may result the wrong pixel size
This commit is contained in:
parent
f1fe4ca8b8
commit
2fe3879b15
|
@ -132,8 +132,13 @@ static NSString * kSDCGImageDestinationRequestedFileSize = @"kCGImageDestination
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
decodingOptions = @{
|
decodingOptions = @{
|
||||||
|
// This option will cause ImageIO return the pixel size from `CGImageSourceCopyProperties`
|
||||||
|
// If not provided, it always return 0 size
|
||||||
kSDCGImageSourceRasterizationDPI : @(rasterizationDPI),
|
kSDCGImageSourceRasterizationDPI : @(rasterizationDPI),
|
||||||
};
|
};
|
||||||
|
// Already calculated DPI, avoid re-calculation based on thumbnail information
|
||||||
|
preserveAspectRatio = YES;
|
||||||
|
thumbnailSize = CGSizeZero;
|
||||||
}
|
}
|
||||||
|
|
||||||
UIImage *image = [SDImageIOAnimatedCoder createFrameAtIndex:0 source:source scale:scale preserveAspectRatio:preserveAspectRatio thumbnailSize:thumbnailSize options:decodingOptions];
|
UIImage *image = [SDImageIOAnimatedCoder createFrameAtIndex:0 source:source scale:scale preserveAspectRatio:preserveAspectRatio thumbnailSize:thumbnailSize options:decodingOptions];
|
||||||
|
|
Loading…
Reference in New Issue