Skip to content

Commit

Permalink
limited image formats
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexandre Vallette authored and Alexandre Vallette committed Dec 8, 2014
1 parent e3208e9 commit 82cc22b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion check.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
# process images and add them to answer
for part in msg.walk():
atype, fformat = part.get_content_type().split("/")
if atype == "image":
if atype == "image" and (fformat in ["jpeg", "png", "jpg"]):
open('attachment.' + fformat, 'wb').write(part.get_payload(decode=True))
check_call(["python", os.path.abspath("scan.py"), "-i", os.path.abspath("attachment." + fformat), "-b", bw, "-a", a4])
img_data = open(os.path.abspath("out.pdf"), 'rb').read()
Expand Down

0 comments on commit 82cc22b

Please sign in to comment.