Skip to content

Commit a3d9633

Browse files
committed
Maintenance update
Organized Source code to improve readability.
1 parent 2cc9208 commit a3d9633

14 files changed

Lines changed: 419 additions & 409 deletions

File tree

Python Source Code/Fix/__init__.py

Lines changed: 0 additions & 4 deletions
This file was deleted.

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ A simple Metadata Removal Tool for removing metadata from images and videos. Dev
33

44
# Whats the Use?
55

6-
<img src="https://github.com/Anish-M-code/Metadata-Remover/raw/master/Screen%20Shots/Scan.JPG">
6+
<img src="https://github.com/Anish-M-code/Metadata-Remover/raw/master/screenshots/Scan.JPG">
77

88
Take back your Privacy Online by removing Identifiable Metadata before you post and reduce size of your images.
99

10-
<img src="https://github.com/Anish-M-code/Metadata-Remover/raw/master/Screen%20Shots/Results.JPG">
10+
<img src="https://github.com/Anish-M-code/Metadata-Remover/raw/master/screenshots/Results.JPG">
1111

1212
Removes Metadata which might expose your location or show which device you used to take photos and videos.
1313

File renamed without changes.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import MRT.commons
2+
import MRT.mrt
3+
import MRT.v9
4+
import MRT.emrt
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
import v9
2-
v9.main()
1+
import v9
2+
v9.main()
Lines changed: 126 additions & 120 deletions
Original file line numberDiff line numberDiff line change
@@ -1,120 +1,126 @@
1-
#flag=imp
2-
3-
''' This is the common library developed to satisfy the needs of commandline python applications .
4-
It contains necessary std libraries and basic functions for its users.'''
5-
6-
7-
try:
8-
import hashlib
9-
import time
10-
import platform
11-
import os
12-
import getpass
13-
import webbrowser
14-
15-
except ImportError:
16-
print('Critical Error:Necessary Python Modules are missing!')
17-
print('Commons module couldnot satisfy all the dependencies!')
18-
x=input('\nPress any key to exit...')
19-
exit()
20-
21-
def r(f):
22-
if os.path.exists(f):
23-
os.remove(f)
24-
25-
def detect(cmd,web,snam,pkg):
26-
27-
if platform.system().lower()=='windows':
28-
if os.system(cmd+'>chk')!=0:
29-
os.system('cls')
30-
print('\nError: '+pkg+' is not detected!')
31-
print('\nPlease wait opening '+snam +' website in your browser!\nYou Have to download and install it.\n')
32-
webbrowser.open(web)
33-
x=input('\nPress any key to exit...')
34-
r('chk')
35-
exit()
36-
37-
else:
38-
if os.system(cmd+'>chk')!=0:
39-
os.system('clear')
40-
print('\nError:'+pkg+' is not detected!\n Please install The package to continue.')
41-
x=input('\nPress any key to exit...')
42-
r('chk')
43-
exit()
44-
r('chk')
45-
46-
47-
def start():
48-
print('\n<-----Task Started----->\n')
49-
50-
def end():
51-
print('\n<-----Task Completed----->\n')
52-
53-
def tsks():
54-
start()
55-
56-
def tske():
57-
end()
58-
59-
def tskf():
60-
print('\n<-----Task Failed !----->\n')
61-
62-
63-
def wait():
64-
x=input('\nPress any key to continue...\n')
65-
66-
def display(file):
67-
with open(file,'r') as f:
68-
s=f.read(1024)
69-
print(s)
70-
while len(s)>0:
71-
s=f.read(1024)
72-
print(s)
73-
74-
75-
def gpg():
76-
detect('gpg --version','https://gpg4win.org','gpg4win','Gnupg')
77-
78-
79-
def exiftool():
80-
detect('exiftool -h','https://exiftool.org','exiftool','Exiftool')
81-
82-
def ffmpeg():
83-
detect('ffmpeg --help','https://ffmpeg.org/','ffmpeg','ffmpeg')
84-
85-
86-
def copy(file,file1):
87-
if os.path.exists(file):
88-
f=open(file,'r')
89-
s=open(file1,'a+')
90-
if os.path.getsize(file)<(1024*1024*1024):
91-
buff=f.read()
92-
s.write('\n-------------------------------------------------------\n')
93-
s.write(buff)
94-
f.close()
95-
s.close()
96-
97-
def bcopy(file,file1):
98-
if os.path.exists(file):
99-
f=open(file,'rb')
100-
s=open(file1,'ab+')
101-
if os.path.getsize(file)<(1024*1024*1024):
102-
buff=f.read()
103-
s.write(buff)
104-
f.close()
105-
s.close()
106-
107-
def cls():
108-
if platform.system().lower()=='windows':
109-
os.system('cls')
110-
else:
111-
os.system('clear')
112-
113-
114-
115-
116-
117-
118-
119-
120-
1+
#flag=imp
2+
3+
'''
4+
This is the common library developed to satisfy the needs of commandline python applications .
5+
It contains necessary std libraries and basic functions for its users.
6+
'''
7+
8+
try:
9+
import hashlib
10+
import time
11+
import platform
12+
import os
13+
import getpass
14+
import webbrowser
15+
16+
except ImportError:
17+
print('Critical Error: Necessary Python Modules are missing!')
18+
print('Commons module couldnot satisfy all the dependencies!')
19+
x=input('\nPress any key to exit...')
20+
exit()
21+
22+
# Deletes file after checking if it exists or not.
23+
def r(f):
24+
if os.path.exists(f):
25+
os.remove(f)
26+
27+
# Function to open website if prerequisite software is not found in PC.
28+
def detect(cmd,web,snam,pkg):
29+
30+
if platform.system().lower()=='windows':
31+
if os.system(cmd+'>chk')!=0:
32+
os.system('cls')
33+
print('\nError: '+pkg+' is not detected!')
34+
print('\nPlease wait opening '+snam +' website in your browser!\nYou Have to download and install it.\n')
35+
webbrowser.open(web)
36+
x=input('\nPress any key to exit...')
37+
r('chk')
38+
exit()
39+
40+
else:
41+
if os.system(cmd+'>chk')!=0:
42+
os.system('clear')
43+
print('\nError:'+pkg+' is not detected!\n Please install The package to continue.')
44+
x=input('\nPress any key to exit...')
45+
r('chk')
46+
exit()
47+
r('chk')
48+
49+
50+
def start():
51+
print('\n<-----Task Started----->\n')
52+
53+
def end():
54+
print('\n<-----Task Completed----->\n')
55+
56+
def tsks():
57+
start()
58+
59+
def tske():
60+
end()
61+
62+
def tskf():
63+
print('\n<-----Task Failed !----->\n')
64+
65+
66+
def wait():
67+
x=input('\nPress any key to continue...\n')
68+
69+
# Function to Display contents of text file.
70+
def display(file):
71+
with open(file,'r') as f:
72+
s=f.read(1024)
73+
print(s)
74+
while len(s)>0:
75+
s=f.read(1024)
76+
print(s)
77+
78+
79+
def gpg():
80+
detect('gpg --version','https://gpg4win.org','gpg4win','Gnupg')
81+
82+
83+
def exiftool():
84+
detect('exiftool -h','https://exiftool.org','exiftool','Exiftool')
85+
86+
def ffmpeg():
87+
detect('ffmpeg --help','https://ffmpeg.org/','ffmpeg','ffmpeg')
88+
89+
# Function to copy textfile.
90+
def copy(file,file1):
91+
if os.path.exists(file):
92+
f=open(file,'r')
93+
s=open(file1,'a+')
94+
if os.path.getsize(file)<(1024*1024*1024):
95+
buff=f.read()
96+
s.write('\n-------------------------------------------------------\n')
97+
s.write(buff)
98+
f.close()
99+
s.close()
100+
101+
# Function to copy binaryfile.
102+
def bcopy(file,file1):
103+
if os.path.exists(file):
104+
f=open(file,'rb')
105+
s=open(file1,'ab+')
106+
if os.path.getsize(file)<(1024*1024*1024):
107+
buff=f.read()
108+
s.write(buff)
109+
f.close()
110+
s.close()
111+
112+
# Clearscreen
113+
def cls():
114+
if platform.system().lower()=='windows':
115+
os.system('cls')
116+
else:
117+
os.system('clear')
118+
119+
120+
121+
122+
123+
124+
125+
126+
Lines changed: 39 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,39 @@
1-
try:
2-
from commons import *
3-
except ImportError:
4-
print('commons Module not Found in emrt!')
5-
x=input()
6-
exit()
7-
8-
# This is a extension for mrt module 0.1
9-
10-
def bulkimgScript():
11-
ext=input("\nEnter Image's Extension:")
12-
if ext[0]!='.':
13-
ext='.'+ext
14-
if ext not in ('.jpg','.gif','.bmp','.tiff','.jpeg','.png'):
15-
print('\nInvalid Filename!')
16-
wait()
17-
exit()
18-
if platform.system().lower()=='windows':
19-
with open('runscript.bat','w') as f:
20-
f.write('echo off\nexiftool *'+ext+'>input.txt\n')
21-
f.write('exiftool -all= *'+ext)
22-
f.write('\nexiftool *'+ext+'>output.txt\npause')
23-
print('\nScript Generated Successfully!')
24-
wait()
25-
26-
elif platform.system().lower()=='linux':
27-
with open('runscript.sh','w') as f:
28-
f.write('exiftool *'+ext+'>input.txt\n')
29-
f.write('exiftool -all= *'+ext)
30-
f.write('\nexiftool *'+ext+'>output.txt\n')
31-
print('\nScript Generated Successfully!')
32-
wait()
33-
34-
if __name__=='__main__':
35-
print('\nExtension of MRT module\n')
36-
print('\nCompatible with all commons module versions!')
37-
print('Extension developed by Fixit Project')
38-
wait()
1+
try:
2+
from commons import *
3+
except ImportError:
4+
print('commons Module not Found in emrt!')
5+
x=input()
6+
exit()
7+
8+
# This is a extension for mrt module 0.1
9+
10+
# Function to generate batch/shell script to remove metadata from common image files.
11+
def bulkimgScript():
12+
ext=input("\nEnter Image's Extension:")
13+
if ext[0]!='.':
14+
ext='.'+ext
15+
if ext not in ('.jpg','.gif','.bmp','.tiff','.jpeg','.png'):
16+
print('\nInvalid Filename!')
17+
wait()
18+
exit()
19+
if platform.system().lower()=='windows':
20+
with open('runscript.bat','w') as f:
21+
f.write('echo off\nexiftool *'+ext+'>input.txt\n')
22+
f.write('exiftool -all= *'+ext)
23+
f.write('\nexiftool *'+ext+'>output.txt\npause')
24+
print('\nScript Generated Successfully!')
25+
wait()
26+
27+
elif platform.system().lower()=='linux':
28+
with open('runscript.sh','w') as f:
29+
f.write('exiftool *'+ext+'>input.txt\n')
30+
f.write('exiftool -all= *'+ext)
31+
f.write('\nexiftool *'+ext+'>output.txt\n')
32+
print('\nScript Generated Successfully!')
33+
wait()
34+
35+
if __name__=='__main__':
36+
print('\nExtension of MRT module\n')
37+
print('\nCompatible with all commons module versions!')
38+
print('Extension developed by Fixit Project')
39+
wait()

0 commit comments

Comments
 (0)