diff --git a/SDWebImage/Core/NSData+ImageContentType.m b/SDWebImage/Core/NSData+ImageContentType.m index b3b8e22b..6bce90b5 100644 --- a/SDWebImage/Core/NSData+ImageContentType.m +++ b/SDWebImage/Core/NSData+ImageContentType.m @@ -65,6 +65,15 @@ } break; } + case 0x25: { + if (data.length >= 4) { + //%PDF + NSString *testString = [[NSString alloc] initWithData:[data subdataWithRange:NSMakeRange(1, 4)] encoding:NSASCIIStringEncoding]; + if ([testString isEqualToString:@"PDF"]) { + return SDImageFormatPDF; + } + } + } } return SDImageFormatUndefined; }