Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

reformat code

  • Loading branch information...
commit adffebc8fb6d348658ba55f31ba58199284bf999 1 parent 20bada3
Fabrice Aneche akhenakh authored
Showing with 5 additions and 1 deletion.
  1. +5 −1 NSData+ImageContentType.m
6 NSData+ImageContentType.m
View
@@ -26,11 +26,15 @@ + (NSString *)contentTypeForImageData:(NSData *)data
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;
}
Please sign in to comment.
Something went wrong with that request. Please try again.