diff --git a/SDWebImage.xcodeproj/project.pbxproj b/SDWebImage.xcodeproj/project.pbxproj index 830dc3b5..53d0a04d 100644 --- a/SDWebImage.xcodeproj/project.pbxproj +++ b/SDWebImage.xcodeproj/project.pbxproj @@ -806,6 +806,7 @@ GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", + "SD_WEBP=1", "$(inherited)", ); GCC_SYMBOLS_PRIVATE_EXTERN = NO; @@ -837,6 +838,7 @@ ALWAYS_SEARCH_USER_PATHS = NO; ARCHS = "$(ARCHS_STANDARD_32_BIT)"; COPY_PHASE_STRIP = YES; + GCC_PREPROCESSOR_DEFINITIONS = "SD_WEBP=1"; GCC_TREAT_WARNINGS_AS_ERRORS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES; diff --git a/SDWebImage/UIImage+MultiFormat.m b/SDWebImage/UIImage+MultiFormat.m index a3fb4437..a6905c9e 100644 --- a/SDWebImage/UIImage+MultiFormat.m +++ b/SDWebImage/UIImage+MultiFormat.m @@ -25,10 +25,12 @@ image = [[UIImage alloc] initWithData:data]; } +#ifdef SD_WEBP if (!image) // TODO: detect webp signature { image = [UIImage sd_imageWithWebPData:data]; } +#endif return image; } diff --git a/SDWebImage/UIImage+WebP.h b/SDWebImage/UIImage+WebP.h index 871e41e6..d0743fb3 100644 --- a/SDWebImage/UIImage+WebP.h +++ b/SDWebImage/UIImage+WebP.h @@ -6,6 +6,7 @@ // Copyright (c) 2013 Dailymotion. All rights reserved. // +#ifdef SD_WEBP #import @interface UIImage (WebP) @@ -13,3 +14,4 @@ + (UIImage *)sd_imageWithWebPData:(NSData *)data; @end +#endif diff --git a/SDWebImage/UIImage+WebP.m b/SDWebImage/UIImage+WebP.m index 066de527..46471c84 100644 --- a/SDWebImage/UIImage+WebP.m +++ b/SDWebImage/UIImage+WebP.m @@ -6,6 +6,7 @@ // Copyright (c) 2013 Dailymotion. All rights reserved. // +#ifdef SD_WEBP #import "UIImage+WebP.h" #import "webp/decode.h" @@ -60,3 +61,4 @@ static void FreeImageData(void *info, const void *data, size_t size) } @end +#endif