Last active
December 27, 2015 06:08
-
-
Save cathandnya/7279009 to your computer and use it in GitHub Desktop.
GIFかどうかを判断
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import "NSData+GIF.h" | |
@implementation NSData(GIF) | |
- (BOOL) isGIF { | |
char *bytes = (char *)[self bytes]; | |
return [self length] >= 6 && (strncmp(bytes, "GIF87a", 6) == 0 || strncmp(bytes, "GIF89a", 6) == 0); | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment