Merge pull request #2303 from dreampiggy/fix_duplicated_force_decode_imageIO
Remove the duplicated process to force decode (draw on bitmap context) in Image/IO's progressive decoding.
This commit is contained in:
commit
ac47ce3a0d
|
@ -150,25 +150,6 @@
|
||||||
// Create the image
|
// Create the image
|
||||||
CGImageRef partialImageRef = CGImageSourceCreateImageAtIndex(_imageSource, 0, NULL);
|
CGImageRef partialImageRef = CGImageSourceCreateImageAtIndex(_imageSource, 0, NULL);
|
||||||
|
|
||||||
#if SD_UIKIT || SD_WATCH
|
|
||||||
// Workaround for iOS anamorphic image
|
|
||||||
if (partialImageRef) {
|
|
||||||
const size_t partialHeight = CGImageGetHeight(partialImageRef);
|
|
||||||
CGColorSpaceRef colorSpace = [SDWebImageCoderHelper colorSpaceGetDeviceRGB];
|
|
||||||
CGContextRef bmContext = CGBitmapContextCreate(NULL, _width, _height, 8, 0, colorSpace, kCGBitmapByteOrder32Host | kCGImageAlphaPremultipliedFirst);
|
|
||||||
if (bmContext) {
|
|
||||||
CGContextDrawImage(bmContext, (CGRect){.origin.x = 0.0f, .origin.y = 0.0f, .size.width = _width, .size.height = partialHeight}, partialImageRef);
|
|
||||||
CGImageRelease(partialImageRef);
|
|
||||||
partialImageRef = CGBitmapContextCreateImage(bmContext);
|
|
||||||
CGContextRelease(bmContext);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
CGImageRelease(partialImageRef);
|
|
||||||
partialImageRef = nil;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (partialImageRef) {
|
if (partialImageRef) {
|
||||||
CGFloat scale = _scale;
|
CGFloat scale = _scale;
|
||||||
if ([options valueForKey:SDWebImageCoderDecodeScaleFactor]) {
|
if ([options valueForKey:SDWebImageCoderDecodeScaleFactor]) {
|
||||||
|
|
Loading…
Reference in New Issue