Added the case to detect PDF format from file signature
This commit is contained in:
parent
8ca4556066
commit
08aab785db
|
@ -65,6 +65,15 @@
|
||||||
}
|
}
|
||||||
break;
|
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;
|
return SDImageFormatUndefined;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue