From 6398eedce84e1086a3ee576df1eec4c80a99322b Mon Sep 17 00:00:00 2001 From: DreamPiggy Date: Thu, 19 Jul 2018 01:03:41 +0800 Subject: [PATCH] Rename `sd_UTTypeFromSDImageFormat` to `sd_UTTypeFromImageFormat` --- SDWebImage/NSData+ImageContentType.h | 2 +- SDWebImage/NSData+ImageContentType.m | 2 +- SDWebImage/SDImageAPNGCoder.m | 4 ++-- SDWebImage/SDImageCoderHelper.m | 2 +- SDWebImage/SDImageGIFCoder.m | 4 ++-- SDWebImage/SDImageIOCoder.m | 4 ++-- Tests/Tests/SDCategoriesTests.m | 2 +- 7 files changed, 10 insertions(+), 10 deletions(-) diff --git a/SDWebImage/NSData+ImageContentType.h b/SDWebImage/NSData+ImageContentType.h index 117439d2..2a9f7e2b 100644 --- a/SDWebImage/NSData+ImageContentType.h +++ b/SDWebImage/NSData+ImageContentType.h @@ -37,7 +37,7 @@ typedef NS_ENUM(NSInteger, SDImageFormat) { * @param format Format as SDImageFormat * @return The UTType as CFStringRef */ -+ (nonnull CFStringRef)sd_UTTypeFromSDImageFormat:(SDImageFormat)format CF_RETURNS_NOT_RETAINED; ++ (nonnull CFStringRef)sd_UTTypeFromImageFormat:(SDImageFormat)format CF_RETURNS_NOT_RETAINED; /** * Convert UTTyppe to SDImageFormat diff --git a/SDWebImage/NSData+ImageContentType.m b/SDWebImage/NSData+ImageContentType.m index 64ea0a30..89d5ae29 100644 --- a/SDWebImage/NSData+ImageContentType.m +++ b/SDWebImage/NSData+ImageContentType.m @@ -66,7 +66,7 @@ return SDImageFormatUndefined; } -+ (nonnull CFStringRef)sd_UTTypeFromSDImageFormat:(SDImageFormat)format { ++ (nonnull CFStringRef)sd_UTTypeFromImageFormat:(SDImageFormat)format { CFStringRef UTType; switch (format) { case SDImageFormatJPEG: diff --git a/SDWebImage/SDImageAPNGCoder.m b/SDWebImage/SDImageAPNGCoder.m index 90f98063..f6259775 100644 --- a/SDWebImage/SDImageAPNGCoder.m +++ b/SDWebImage/SDImageAPNGCoder.m @@ -188,7 +188,7 @@ const CFStringRef kCGImagePropertyAPNGUnclampedDelayTime = (__bridge CFStringRef } NSMutableData *imageData = [NSMutableData data]; - CFStringRef imageUTType = [NSData sd_UTTypeFromSDImageFormat:SDImageFormatPNG]; + CFStringRef imageUTType = [NSData sd_UTTypeFromImageFormat:SDImageFormatPNG]; NSArray *frames = [SDImageCoderHelper framesFromAnimatedImage:image]; // Create an image destination. APNG does not support EXIF image orientation @@ -243,7 +243,7 @@ const CFStringRef kCGImagePropertyAPNGUnclampedDelayTime = (__bridge CFStringRef - (instancetype)initIncrementalWithOptions:(nullable SDImageCoderOptions *)options { self = [super init]; if (self) { - CFStringRef imageUTType = [NSData sd_UTTypeFromSDImageFormat:SDImageFormatPNG]; + CFStringRef imageUTType = [NSData sd_UTTypeFromImageFormat:SDImageFormatPNG]; _imageSource = CGImageSourceCreateIncremental((__bridge CFDictionaryRef)@{(__bridge NSString *)kCGImageSourceTypeIdentifierHint : (__bridge NSString *)imageUTType}); CGFloat scale = 1; if ([options valueForKey:SDImageCoderDecodeScaleFactor]) { diff --git a/SDWebImage/SDImageCoderHelper.m b/SDWebImage/SDImageCoderHelper.m index 765e676e..a0e741a4 100644 --- a/SDWebImage/SDImageCoderHelper.m +++ b/SDWebImage/SDImageCoderHelper.m @@ -80,7 +80,7 @@ static const CGFloat kDestSeemOverlap = 2.0f; // the numbers of pixels to over #else NSMutableData *imageData = [NSMutableData data]; - CFStringRef imageUTType = [NSData sd_UTTypeFromSDImageFormat:SDImageFormatGIF]; + CFStringRef imageUTType = [NSData sd_UTTypeFromImageFormat:SDImageFormatGIF]; // Create an image destination. GIF does not support EXIF image orientation CGImageDestinationRef imageDestination = CGImageDestinationCreateWithData((__bridge CFMutableDataRef)imageData, imageUTType, frameCount, NULL); if (!imageDestination) { diff --git a/SDWebImage/SDImageGIFCoder.m b/SDWebImage/SDImageGIFCoder.m index 5dc55419..8936cf7b 100644 --- a/SDWebImage/SDImageGIFCoder.m +++ b/SDWebImage/SDImageGIFCoder.m @@ -183,7 +183,7 @@ - (instancetype)initIncrementalWithOptions:(nullable SDImageCoderOptions *)options { self = [super init]; if (self) { - CFStringRef imageUTType = [NSData sd_UTTypeFromSDImageFormat:SDImageFormatGIF]; + CFStringRef imageUTType = [NSData sd_UTTypeFromImageFormat:SDImageFormatGIF]; _imageSource = CGImageSourceCreateIncremental((__bridge CFDictionaryRef)@{(__bridge NSString *)kCGImageSourceTypeIdentifierHint : (__bridge NSString *)imageUTType}); CGFloat scale = 1; if ([options valueForKey:SDImageCoderDecodeScaleFactor]) { @@ -271,7 +271,7 @@ } NSMutableData *imageData = [NSMutableData data]; - CFStringRef imageUTType = [NSData sd_UTTypeFromSDImageFormat:SDImageFormatGIF]; + CFStringRef imageUTType = [NSData sd_UTTypeFromImageFormat:SDImageFormatGIF]; NSArray *frames = [SDImageCoderHelper framesFromAnimatedImage:image]; // Create an image destination. GIF does not support EXIF image orientation diff --git a/SDWebImage/SDImageIOCoder.m b/SDWebImage/SDImageIOCoder.m index 44826953..11ef5cf0 100644 --- a/SDWebImage/SDImageIOCoder.m +++ b/SDWebImage/SDImageIOCoder.m @@ -203,7 +203,7 @@ } NSMutableData *imageData = [NSMutableData data]; - CFStringRef imageUTType = [NSData sd_UTTypeFromSDImageFormat:format]; + CFStringRef imageUTType = [NSData sd_UTTypeFromImageFormat:format]; // Create an image destination. CGImageDestinationRef imageDestination = CGImageDestinationCreateWithData((__bridge CFMutableDataRef)imageData, imageUTType, 1, NULL); @@ -261,7 +261,7 @@ static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ NSMutableData *imageData = [NSMutableData data]; - CFStringRef imageUTType = [NSData sd_UTTypeFromSDImageFormat:SDImageFormatHEIC]; + CFStringRef imageUTType = [NSData sd_UTTypeFromImageFormat:SDImageFormatHEIC]; // Create an image destination. CGImageDestinationRef imageDestination = CGImageDestinationCreateWithData((__bridge CFMutableDataRef)imageData, imageUTType, 1, NULL); diff --git a/Tests/Tests/SDCategoriesTests.m b/Tests/Tests/SDCategoriesTests.m index 36996529..35233945 100644 --- a/Tests/Tests/SDCategoriesTests.m +++ b/Tests/Tests/SDCategoriesTests.m @@ -24,7 +24,7 @@ expect(format == SDImageFormatUndefined); // Test invalid format - CFStringRef type = [NSData sd_UTTypeFromSDImageFormat:SDImageFormatUndefined]; + CFStringRef type = [NSData sd_UTTypeFromImageFormat:SDImageFormatUndefined]; expect(CFStringCompare(kUTTypePNG, type, 0)).equal(kCFCompareEqualTo); }