Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions Example/SDWebImageWebPCoderExample.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -169,15 +169,11 @@
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
);
name = "[CP] Check Pods Manifest.lock";
outputFileListPaths = (
);
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-SDWebImageWebPCoderExample-checkManifestLockResult.txt",
);
Expand All @@ -191,17 +187,13 @@
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
"${SRCROOT}/Pods/Target Support Files/Pods-SDWebImageWebPCoderExample/Pods-SDWebImageWebPCoderExample-frameworks.sh",
"${BUILT_PRODUCTS_DIR}/SDWebImage/SDWebImage.framework",
"${BUILT_PRODUCTS_DIR}/SDWebImageWebPCoder/SDWebImageWebPCoder.framework",
"${BUILT_PRODUCTS_DIR}/libwebp/libwebp.framework",
);
name = "[CP] Embed Pods Frameworks";
outputFileListPaths = (
);
outputPaths = (
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SDWebImage.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SDWebImageWebPCoder.framework",
Expand Down
30 changes: 15 additions & 15 deletions SDWebImageWebPCoder.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -485,17 +485,13 @@
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
"${SRCROOT}/SDWebImageWebPCoderTests/Pods/Target Support Files/Pods-SDWebImageWebPCoderTests/Pods-SDWebImageWebPCoderTests-frameworks.sh",
"${BUILT_PRODUCTS_DIR}/SDWebImage/SDWebImage.framework",
"${BUILT_PRODUCTS_DIR}/SDWebImageWebPCoder/SDWebImageWebPCoder.framework",
"${BUILT_PRODUCTS_DIR}/libwebp/libwebp.framework",
);
name = "[CP] Embed Pods Frameworks";
outputFileListPaths = (
);
outputPaths = (
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SDWebImage.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SDWebImageWebPCoder.framework",
Expand All @@ -511,15 +507,11 @@
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
);
name = "[CP] Check Pods Manifest.lock";
outputFileListPaths = (
);
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-SDWebImageWebPCoderTests-checkManifestLockResult.txt",
);
Expand Down Expand Up @@ -624,11 +616,16 @@
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"SD_WEBP=1",
"$(inherited)",
);
"GCC_PREPROCESSOR_DEFINITIONS[sdk=watchos*]" = "WEBP_USE_INTRINSICS=1 $(inherited)";
"GCC_PREPROCESSOR_DEFINITIONS[sdk=watchsimulator*]" = "WEBP_USE_INTRINSICS=1 $(inherited)";
"GCC_PREPROCESSOR_DEFINITIONS[sdk=watchos*]" = (
"WEBP_USE_INTRINSICS=1",
"$(inherited)",
);
"GCC_PREPROCESSOR_DEFINITIONS[sdk=watchsimulator*]" = (
"WEBP_USE_INTRINSICS=1",
"$(inherited)",
);
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
Expand Down Expand Up @@ -695,12 +692,15 @@
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_NO_COMMON_BLOCKS = YES;
GCC_PREPROCESSOR_DEFINITIONS = (
"SD_WEBP=1",
GCC_PREPROCESSOR_DEFINITIONS = "$(inherited)";
"GCC_PREPROCESSOR_DEFINITIONS[sdk=watchos*]" = (
"WEBP_USE_INTRINSICS=1",
"$(inherited)",
);
"GCC_PREPROCESSOR_DEFINITIONS[sdk=watchsimulator*]" = (
"WEBP_USE_INTRINSICS=1",
"$(inherited)",
);
"GCC_PREPROCESSOR_DEFINITIONS[sdk=watchos*]" = "WEBP_USE_INTRINSICS=1 $(inherited)";
"GCC_PREPROCESSOR_DEFINITIONS[sdk=watchsimulator*]" = "WEBP_USE_INTRINSICS=1 $(inherited)";
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 0 additions & 4 deletions SDWebImageWebPCoder/Classes/SDImageWebPCoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
* file that was distributed with this source code.
*/

#ifdef SD_WEBP

#import <Foundation/Foundation.h>
#import <SDWebImage/SDImageCoder.h>

Expand All @@ -19,5 +17,3 @@
@property (nonatomic, class, readonly, nonnull) SDImageWebPCoder *sharedCoder;

@end

#endif
19 changes: 11 additions & 8 deletions SDWebImageWebPCoder/Classes/SDImageWebPCoder.m
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
* file that was distributed with this source code.
*/

#ifdef SD_WEBP

#import "SDImageWebPCoder.h"
#import <SDWebImage/SDImageCoderHelper.h>
#if __has_include(<SDWebImage/NSImage+Compatibility.h>)
Expand All @@ -30,6 +28,14 @@

#import <Accelerate/Accelerate.h>

#ifndef SD_LOCK
#define SD_LOCK(lock) dispatch_semaphore_wait(lock, DISPATCH_TIME_FOREVER);
#endif

#ifndef SD_UNLOCK
#define SD_UNLOCK(lock) dispatch_semaphore_signal(lock);
#endif

@interface SDWebPCoderFrame : NSObject

@property (nonatomic, assign) NSUInteger index; // Frame index (zero based)
Expand Down Expand Up @@ -748,9 +754,9 @@ - (UIImage *)animatedImageFrameAtIndex:(NSUInteger)index {
if (index >= _frameCount) {
return nil;
}
LOCKBLOCK({
image = [self safeAnimatedImageFrameAtIndex:index];
});
SD_LOCK(_lock);
image = [self safeAnimatedImageFrameAtIndex:index];
SD_UNLOCK(_lock);
return image;
}

Expand Down Expand Up @@ -826,6 +832,3 @@ - (UIImage *)safeAnimatedImageFrameAtIndex:(NSUInteger)index {
}

@end

#endif

4 changes: 0 additions & 4 deletions SDWebImageWebPCoder/Classes/UIImage+WebP.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
* file that was distributed with this source code.
*/

#ifdef SD_WEBP

#import <SDWebImage/SDWebImageCompat.h>

// This category is just use as a convenience method. For more detail control, use methods in `UIImage+MultiFormat.h` or directlly use `SDImageCoder`
Expand All @@ -23,5 +21,3 @@
+ (nullable UIImage *)sd_imageWithWebPData:(nullable NSData *)data;

@end

#endif
4 changes: 0 additions & 4 deletions SDWebImageWebPCoder/Classes/UIImage+WebP.m
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
* file that was distributed with this source code.
*/

#ifdef SD_WEBP

#import "UIImage+WebP.h"
#import "SDImageWebPCoder.h"

Expand All @@ -21,5 +19,3 @@ + (nullable UIImage *)sd_imageWithWebPData:(nullable NSData *)data {
}

@end

#endif