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 6d50f03 commit 62b1949Copy full SHA for 62b1949
IMAGES & PHOTO SCRIPTS/Image-Inverter/inverter.py
@@ -17,12 +17,11 @@ def main():
17
i = i + 1
18
continue
19
20
- file_name = os.path.splitext(file)
21
- try:
22
- with Image.open(file) as image:
23
- ImageOps.invert(image).save(file_name + "_inverted", "JPEG")
24
- except:
25
- print("Couldn't convert " + file_name + "successfully!")
+ image_path, extension = os.path.splitext(file)
+
+ with Image.open(file) as image:
+ ImageOps.invert(image).save(image_path + "_inverted" + extension, "JPEG")
26
27
28
if __name__ == '__main__':
0 commit comments