changes in the import
This commit is contained in:
parent
0c0ad624d1
commit
1f68ac14a2
5 changed files with 52 additions and 1 deletions
|
@ -18,7 +18,6 @@
|
|||
// limitations under the License.
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "OAMutableURLRequest.h"
|
||||
#import "OAToken.h"
|
||||
#import "OAServiceTicket.h"
|
||||
#import "OADataFetcher.h"
|
||||
|
|
1
Pods/BuildHeaders/SDWebImage/NSData+ImageContentType.h
generated
Symbolic link
1
Pods/BuildHeaders/SDWebImage/NSData+ImageContentType.h
generated
Symbolic link
|
@ -0,0 +1 @@
|
|||
../../SDWebImage/SDWebImage/NSData+ImageContentType.h
|
1
Pods/Headers/SDWebImage/NSData+ImageContentType.h
generated
Symbolic link
1
Pods/Headers/SDWebImage/NSData+ImageContentType.h
generated
Symbolic link
|
@ -0,0 +1 @@
|
|||
../../SDWebImage/SDWebImage/NSData+ImageContentType.h
|
10
Pods/SDWebImage/SDWebImage/NSData+ImageContentType.h
generated
Normal file
10
Pods/SDWebImage/SDWebImage/NSData+ImageContentType.h
generated
Normal file
|
@ -0,0 +1,10 @@
|
|||
//
|
||||
// Created by Fabrice Aneche on 06/01/14.
|
||||
// Copyright (c) 2014 Dailymotion. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@interface NSData (ImageContentType)
|
||||
+ (NSString *)contentTypeForImageData:(NSData *)data;
|
||||
@end
|
40
Pods/SDWebImage/SDWebImage/NSData+ImageContentType.m
generated
Normal file
40
Pods/SDWebImage/SDWebImage/NSData+ImageContentType.m
generated
Normal file
|
@ -0,0 +1,40 @@
|
|||
//
|
||||
// Created by Fabrice Aneche on 06/01/14.
|
||||
// Copyright (c) 2014 Dailymotion. All rights reserved.
|
||||
//
|
||||
|
||||
#import "NSData+ImageContentType.h"
|
||||
|
||||
|
||||
@implementation NSData (ImageContentType)
|
||||
|
||||
+ (NSString *)contentTypeForImageData:(NSData *)data {
|
||||
uint8_t c;
|
||||
[data getBytes:&c length:1];
|
||||
switch (c) {
|
||||
case 0xFF:
|
||||
return @"image/jpeg";
|
||||
case 0x89:
|
||||
return @"image/png";
|
||||
case 0x47:
|
||||
return @"image/gif";
|
||||
case 0x49:
|
||||
case 0x4D:
|
||||
return @"image/tiff";
|
||||
case 0x52:
|
||||
// R as RIFF for WEBP
|
||||
if ([data length] < 12) {
|
||||
return nil;
|
||||
}
|
||||
|
||||
NSString *testString = [[NSString alloc] initWithData:[data subdataWithRange:NSMakeRange(0, 12)] encoding:NSASCIIStringEncoding];
|
||||
if ([testString hasPrefix:@"RIFF"] && [testString hasSuffix:@"WEBP"]) {
|
||||
return @"image/webp";
|
||||
}
|
||||
|
||||
return nil;
|
||||
}
|
||||
return nil;
|
||||
}
|
||||
|
||||
@end
|
Loading…
Add table
Add a link
Reference in a new issue