Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 10 additions & 9 deletions imago/extractor.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@


def basic_info(filename):
exit("quitting ...")
print ("Extraction of basic information: %s" % (filename,))
statinfo = os.stat(filename)
mime = magic.from_file(filename, mime=True)
Expand Down Expand Up @@ -69,7 +70,7 @@ def sha512(filename):
#modified version of a gist by: https://github.com/ewencp
##BETA##
def ela(filename, output_path):
print "****ELA is in BETA****"
print ("****ELA is in BETA****")
if magic.from_file(filename, mime=True) == "image/jpeg":
quality_level = 85
tmp_img = os.path.join(output_path,os.path.basename(filename)+".tmp.jpg")
Expand All @@ -85,7 +86,7 @@ def ela(filename, output_path):
ela_image.save(ela)
os.remove(tmp_img)
else:
print "ELA works only with JPEG"
print ("ELA works only with JPEG")


#Modified version of a gist by: https://github.com/erans
Expand Down Expand Up @@ -140,11 +141,11 @@ def PIL_exif_data_GPS(filename):
for a in address.keys():
helper.sqlite_insert(a,str(address[a]),os.path.basename(filename))
except:
print "Problem during geopy decode"
print ("Problem during geopy decode")

return latitude, longitude
else:
print "GPS works only with JPEG"
print ("GPS works only with JPEG")
return None


Expand All @@ -160,7 +161,7 @@ def detect_nudity(filename):
helper.sqlite_insert("Nudity",nudity,os.path.basename(filename))
return nudity
else:
print "Nudity Detection works only with JPEG"
print ("Nudity Detection works only with JPEG")
return None

#based on JohannesBuchner imagehash
Expand All @@ -174,7 +175,7 @@ def ahash(filename):
helper.sqlite_insert("aHash",str(hash),os.path.basename(filename))
return hash
else:
print "aHash works only with images"
print ("aHash works only with images")
return None

#based on JohannesBuchner imagehash
Expand All @@ -186,7 +187,7 @@ def phash(filename):
helper.sqlite_insert("pHash",str(hash),os.path.basename(filename))
return hash
else:
print "pHash works only with images"
print ("pHash works only with images")
return None

#based on JohannesBuchner imagehash
Expand All @@ -198,7 +199,7 @@ def whash(filename):
helper.sqlite_insert("wHash",str(hash),os.path.basename(filename))
return hash
else:
print "wHash works only with image images"
print ("wHash works only with image images")
return None

#based on JohannesBuchner imagehash
Expand All @@ -210,5 +211,5 @@ def dhash(filename):
helper.sqlite_insert("dHash",str(hash),os.path.basename(filename))
return hash
else:
print "dHash vertical works only with image images"
print ("dHash vertical works only with image images")
return None
2 changes: 1 addition & 1 deletion imago/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def initialize_sqli(*arg):
(filename text )''')
conn.commit()
except:
print "Problem during table creation"
print ("Problem during table creation")
finally:
c.close()
return True
Expand Down
4 changes: 2 additions & 2 deletions imago/imago.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
from os import walk

def main(args=None):
print """\
print ("""\
##################################################
# imago.py #
# Digital evidences from images! #
# Made with <3 by Matteo Redaelli #
# Twitter: @solventred #
##################################################
"""
""")
if args is None:
args = sys.argv[1:]
parser = argparse.ArgumentParser()
Expand Down
17 changes: 17 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
# to install pillow on linux mint
# use this url : https://gist.github.com/DavidToca/6063298
# if you get error
# about liblcms1-dev and libjpeg62-dev;
# then change liblcms1-dev to liblcms2-dev
# and do
# sudo apt-get install aptitude
# sudo aptitude install libjpeg62-dev
# to install libjpeg62-dev
# if wheel issues come up
# try
# -------------------------------------
# sudo apt-get install gcc libpq-dev -y
# sudo apt-get install python-dev python-pip -y
# sudo apt-get install python3-dev python3-pip python3-venv python3-wheel -y
# pip3 install wheel

exifread>=2.1.2
python-magic>=0.4.15
argparse>=1.4.0
Expand Down