Checks for input file existence first.

master
Rostislav Lán 2 years ago
parent 68b9deaae3
commit 71771d0217

@ -7,6 +7,7 @@
import argparse as ap import argparse as ap
import sys import sys
import json import json
from os.path import exists
# Libraries for image processing # Libraries for image processing
import numpy as np import numpy as np
@ -59,7 +60,11 @@ class apply_filters:
self.output_file = self.args.output_file self.output_file = self.args.output_file
self.dpi = self.args.dpi self.dpi = self.args.dpi
self.mirror = True if self.args.mirror else False self.mirror = True if self.args.mirror else False
if exists(self.input_file):
self.run() self.run()
else:
print("Input file does not exist", file=sys.stderr)
exit(1)
def run(self): def run(self):
# read as numpy.array # read as numpy.array

Loading…
Cancel
Save