Fix the warning of deprecated API `CGColorSpaceCreateWithICCProfile`

This commit is contained in:
DreamPiggy 2019-10-02 17:00:47 +08:00
parent d53b482d80
commit 177343a714
4 changed files with 19 additions and 37 deletions

View File

@ -187,17 +187,12 @@
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
); );
inputPaths = ( inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-SDWebImageWebPCoderExample/Pods-SDWebImageWebPCoderExample-frameworks.sh", "${PODS_ROOT}/Target Support Files/Pods-SDWebImageWebPCoderExample/Pods-SDWebImageWebPCoderExample-frameworks-${CONFIGURATION}-input-files.xcfilelist",
"${BUILT_PRODUCTS_DIR}/SDWebImage/SDWebImage.framework",
"${BUILT_PRODUCTS_DIR}/SDWebImageWebPCoder/SDWebImageWebPCoder.framework",
"${BUILT_PRODUCTS_DIR}/libwebp/libwebp.framework",
); );
name = "[CP] Embed Pods Frameworks"; name = "[CP] Embed Pods Frameworks";
outputPaths = ( outputFileListPaths = (
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SDWebImage.framework", "${PODS_ROOT}/Target Support Files/Pods-SDWebImageWebPCoderExample/Pods-SDWebImageWebPCoderExample-frameworks-${CONFIGURATION}-output-files.xcfilelist",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SDWebImageWebPCoder.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/libwebp.framework",
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh; shellPath = /bin/sh;

View File

@ -491,17 +491,12 @@
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
); );
inputPaths = ( inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-SDWebImageWebPCoderTests/Pods-SDWebImageWebPCoderTests-frameworks.sh", "${PODS_ROOT}/Target Support Files/Pods-SDWebImageWebPCoderTests/Pods-SDWebImageWebPCoderTests-frameworks-${CONFIGURATION}-input-files.xcfilelist",
"${BUILT_PRODUCTS_DIR}/SDWebImage/SDWebImage.framework",
"${BUILT_PRODUCTS_DIR}/SDWebImageWebPCoder/SDWebImageWebPCoder.framework",
"${BUILT_PRODUCTS_DIR}/libwebp/libwebp.framework",
); );
name = "[CP] Embed Pods Frameworks"; name = "[CP] Embed Pods Frameworks";
outputPaths = ( outputFileListPaths = (
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SDWebImage.framework", "${PODS_ROOT}/Target Support Files/Pods-SDWebImageWebPCoderTests/Pods-SDWebImageWebPCoderTests-frameworks-${CONFIGURATION}-output-files.xcfilelist",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SDWebImageWebPCoder.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/libwebp.framework",
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh; shellPath = /bin/sh;
@ -624,14 +619,8 @@
"DEBUG=1", "DEBUG=1",
"$(inherited)", "$(inherited)",
); );
"GCC_PREPROCESSOR_DEFINITIONS[sdk=watchos*]" = ( "GCC_PREPROCESSOR_DEFINITIONS[sdk=watchos*]" = "WEBP_USE_INTRINSICS=1 $(inherited)";
"WEBP_USE_INTRINSICS=1", "GCC_PREPROCESSOR_DEFINITIONS[sdk=watchsimulator*]" = "WEBP_USE_INTRINSICS=1 $(inherited)";
"$(inherited)",
);
"GCC_PREPROCESSOR_DEFINITIONS[sdk=watchsimulator*]" = (
"WEBP_USE_INTRINSICS=1",
"$(inherited)",
);
GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNDECLARED_SELECTOR = YES;
@ -699,14 +688,8 @@
GCC_C_LANGUAGE_STANDARD = gnu11; GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_NO_COMMON_BLOCKS = YES; GCC_NO_COMMON_BLOCKS = YES;
GCC_PREPROCESSOR_DEFINITIONS = "$(inherited)"; GCC_PREPROCESSOR_DEFINITIONS = "$(inherited)";
"GCC_PREPROCESSOR_DEFINITIONS[sdk=watchos*]" = ( "GCC_PREPROCESSOR_DEFINITIONS[sdk=watchos*]" = "WEBP_USE_INTRINSICS=1 $(inherited)";
"WEBP_USE_INTRINSICS=1", "GCC_PREPROCESSOR_DEFINITIONS[sdk=watchsimulator*]" = "WEBP_USE_INTRINSICS=1 $(inherited)";
"$(inherited)",
);
"GCC_PREPROCESSOR_DEFINITIONS[sdk=watchsimulator*]" = (
"WEBP_USE_INTRINSICS=1",
"$(inherited)",
);
GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNDECLARED_SELECTOR = YES;

View File

@ -5,10 +5,10 @@
location = "group:Example/SDWebImageWebPCoderExample.xcodeproj"> location = "group:Example/SDWebImageWebPCoderExample.xcodeproj">
</FileRef> </FileRef>
<FileRef <FileRef
location = "group:Example/Pods/Pods.xcodeproj"> location = "group:SDWebImageWebPCoder.xcodeproj">
</FileRef> </FileRef>
<FileRef <FileRef
location = "group:SDWebImageWebPCoder.xcodeproj"> location = "group:Example/Pods/Pods.xcodeproj">
</FileRef> </FileRef>
<FileRef <FileRef
location = "group:SDWebImageWebPCoderTests/Pods/Pods.xcodeproj"> location = "group:SDWebImageWebPCoderTests/Pods/Pods.xcodeproj">

View File

@ -432,7 +432,11 @@
// See #2618, the `CGColorSpaceCreateWithICCProfile` does not copy ICC Profile data, it only retain `CFDataRef`. // See #2618, the `CGColorSpaceCreateWithICCProfile` does not copy ICC Profile data, it only retain `CFDataRef`.
// When the libwebp `WebPDemuxer` dealloc, all chunks will be freed. So we must copy the ICC data (really cheap, less than 10KB) // When the libwebp `WebPDemuxer` dealloc, all chunks will be freed. So we must copy the ICC data (really cheap, less than 10KB)
NSData *profileData = [NSData dataWithBytes:chunk_iter.chunk.bytes length:chunk_iter.chunk.size]; NSData *profileData = [NSData dataWithBytes:chunk_iter.chunk.bytes length:chunk_iter.chunk.size];
colorSpaceRef = CGColorSpaceCreateWithICCProfile((__bridge CFDataRef)profileData); if (@available(iOS 10, tvOS 10, macOS 10.12, watchOS 3, *)) {
colorSpaceRef = CGColorSpaceCreateWithICCData((__bridge CFDataRef)profileData);
} else {
colorSpaceRef = CGColorSpaceCreateWithICCProfile((__bridge CFDataRef)profileData);
}
WebPDemuxReleaseChunkIterator(&chunk_iter); WebPDemuxReleaseChunkIterator(&chunk_iter);
if (colorSpaceRef) { if (colorSpaceRef) {
// We use RGB color model to decode WebP images currently, so we must filter out other colorSpace // We use RGB color model to decode WebP images currently, so we must filter out other colorSpace