From 8f49d753b4e98d8d0b85ea3447c60e2d7b7aa485 Mon Sep 17 00:00:00 2001 From: DreamPiggy Date: Wed, 25 Apr 2018 15:54:17 +0800 Subject: [PATCH] Remove the duplicated process to force decode (draw on bitmap context) in Image/IO's progressive decoding. This is the bug in early version of Image/IO framework, but now it's already been fixed and duplicated process impact performance --- SDWebImage/SDWebImageImageIOCoder.m | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/SDWebImage/SDWebImageImageIOCoder.m b/SDWebImage/SDWebImageImageIOCoder.m index e35d2f7f..10c36666 100644 --- a/SDWebImage/SDWebImageImageIOCoder.m +++ b/SDWebImage/SDWebImageImageIOCoder.m @@ -150,25 +150,6 @@ // Create the image 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) { CGFloat scale = _scale; if ([options valueForKey:SDWebImageCoderDecodeScaleFactor]) {