- Quick comment ToDo: Avoid using Magic in future releases

pull/199/head
Steve Clement 2018-06-29 12:01:17 +08:00
parent 60a3fbe282
commit fbb3617f25
1 changed files with 1 additions and 1 deletions

View File

@ -45,7 +45,7 @@ def handler(q=False):
r = {'results': []}
request = json.loads(q)
document = base64.b64decode(request["data"])
if magic.from_buffer(document, mime=True).split("/")[1] == 'pdf':
if magic.from_buffer(document, mime=True).split("/")[1] == 'pdf': # Eventually this could be replaced with wand.obj.format
print("PDF Detected")
with WImage(blob=document) as pdf:
pages=len(pdf.sequence)