Do not enable webp when not explicitly activated by a macro (fix #415)
This commit is contained in:
parent
90d120258e
commit
5ecb8d56af
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
// Copyright (c) 2013 Dailymotion. All rights reserved.
|
||||
//
|
||||
|
||||
#ifdef SD_WEBP
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
@interface UIImage (WebP)
|
||||
|
@ -13,3 +14,4 @@
|
|||
+ (UIImage *)sd_imageWithWebPData:(NSData *)data;
|
||||
|
||||
@end
|
||||
#endif
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue