Accept PDFs with whitespace ahead of %PDF marker

Noticed in @aagahi 's fork
This commit is contained in:
James R. Barlow
2017-06-26 13:17:47 -07:00
parent 3a7c3417bb
commit 48e3b267fc
+2 -2
View File
@@ -165,8 +165,8 @@ def triage(
options = context.get_options()
try:
with open(input_file, 'rb') as f:
signature = f.read(4)
if signature == b'%PDF':
signature = f.read(1024)
if b'%PDF' in signature:
if options.image_dpi:
log.warning("Argument --image-dpi ignored because the "
"input file is a PDF, not an image.")