We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2ebec62 commit d9709adCopy full SHA for d9709ad
IMAGES & PHOTO SCRIPTS/Image-Inverter/inverter.py
@@ -11,19 +11,20 @@ def check_input():
11
sys.exit(1)
12
13
def main():
14
+ """ The main function """
15
check_input()
16
17
i = 0
- for file in sys.argv:
18
- # ignore the first parameter -> the script call
+ for file in sys.argv:
19
+ # To ignore the first parameter -> the script call
20
if i == 0:
21
i = i + 1
22
continue
23
- image_path, extension = os.path.splitext(file)
24
+ image_path_no_ext, extension = os.path.splitext(file)
25
26
with Image.open(file) as image:
- ImageOps.invert(image).save(image_path + "_inverted" + extension)
27
+ ImageOps.invert(image).save(image_path_no_ext + "_inverted" + extension)
28
29
30
0 commit comments