diff --git a/SDWebImage/SDImageAPNGCoder.m b/SDWebImage/SDImageAPNGCoder.m index a7cea27b..8c58aa1b 100644 --- a/SDWebImage/SDImageAPNGCoder.m +++ b/SDWebImage/SDImageAPNGCoder.m @@ -203,7 +203,7 @@ const CFStringRef kCGImagePropertyAPNGUnclampedDelayTime = (__bridge CFStringRef if (options[SDImageCoderEncodeCompressionQuality]) { compressionQuality = [options[SDImageCoderEncodeCompressionQuality] doubleValue]; } - [properties setValue:@(compressionQuality) forKey:(__bridge NSString *)kCGImageDestinationLossyCompressionQuality]; + properties[(__bridge NSString *)kCGImageDestinationLossyCompressionQuality] = @(compressionQuality); BOOL encodeFirstFrame = [options[SDImageCoderEncodeFirstFrameOnly] boolValue]; if (encodeFirstFrame || frames.count == 0) { @@ -213,7 +213,7 @@ const CFStringRef kCGImagePropertyAPNGUnclampedDelayTime = (__bridge CFStringRef // for animated APNG images NSUInteger loopCount = image.sd_imageLoopCount; NSDictionary *pngProperties = @{(__bridge NSString *)kCGImagePropertyAPNGLoopCount : @(loopCount)}; - [properties setValue:pngProperties forKey:(__bridge NSString *)kCGImagePropertyPNGDictionary]; + properties[(__bridge NSString *)kCGImagePropertyPNGDictionary] = pngProperties; CGImageDestinationSetProperties(imageDestination, (__bridge CFDictionaryRef)properties); for (size_t i = 0; i < frames.count; i++) { diff --git a/SDWebImage/SDImageGIFCoder.m b/SDWebImage/SDImageGIFCoder.m index 41cd4e00..008a2b0b 100644 --- a/SDWebImage/SDImageGIFCoder.m +++ b/SDWebImage/SDImageGIFCoder.m @@ -288,7 +288,7 @@ if (options[SDImageCoderEncodeCompressionQuality]) { compressionQuality = [options[SDImageCoderEncodeCompressionQuality] doubleValue]; } - [properties setValue:@(compressionQuality) forKey:(__bridge NSString *)kCGImageDestinationLossyCompressionQuality]; + properties[(__bridge NSString *)kCGImageDestinationLossyCompressionQuality] = @(compressionQuality); BOOL encodeFirstFrame = [options[SDImageCoderEncodeFirstFrameOnly] boolValue]; if (encodeFirstFrame || frames.count == 0) { @@ -298,7 +298,7 @@ // for animated GIF images NSUInteger loopCount = image.sd_imageLoopCount; NSDictionary *gifProperties = @{(__bridge NSString *)kCGImagePropertyGIFLoopCount : @(loopCount)}; - [properties setValue:gifProperties forKey:(__bridge NSString *)kCGImagePropertyGIFDictionary]; + properties[(__bridge NSString *)kCGImagePropertyGIFDictionary] = gifProperties; CGImageDestinationSetProperties(imageDestination, (__bridge CFDictionaryRef)properties); for (size_t i = 0; i < frames.count; i++) { diff --git a/SDWebImage/SDImageIOCoder.m b/SDWebImage/SDImageIOCoder.m index 7a34ee8e..a103a265 100644 --- a/SDWebImage/SDImageIOCoder.m +++ b/SDWebImage/SDImageIOCoder.m @@ -221,12 +221,12 @@ #else CGImagePropertyOrientation exifOrientation = kCGImagePropertyOrientationUp; #endif - [properties setValue:@(exifOrientation) forKey:(__bridge NSString *)kCGImagePropertyOrientation]; + properties[(__bridge NSString *)kCGImagePropertyOrientation] = @(exifOrientation); double compressionQuality = 1; if (options[SDImageCoderEncodeCompressionQuality]) { compressionQuality = [options[SDImageCoderEncodeCompressionQuality] doubleValue]; } - [properties setValue:@(compressionQuality) forKey:(__bridge NSString *)kCGImageDestinationLossyCompressionQuality]; + properties[(__bridge NSString *)kCGImageDestinationLossyCompressionQuality] = @(compressionQuality); // Add your image to the destination. CGImageDestinationAddImage(imageDestination, image.CGImage, (__bridge CFDictionaryRef)properties); diff --git a/SDWebImage/SDWebImageManager.m b/SDWebImage/SDWebImageManager.m index 33f5f6c6..bddb4c85 100644 --- a/SDWebImage/SDWebImageManager.m +++ b/SDWebImage/SDWebImageManager.m @@ -233,7 +233,7 @@ static id _defaultImageLoader; } else { mutableContext = [NSMutableDictionary dictionary]; } - [mutableContext setValue:cachedImage forKey:SDWebImageContextLoaderCachedImage]; + mutableContext[SDWebImageContextLoaderCachedImage] = cachedImage; context = [mutableContext copy]; }