Checks for input file existence first.
This commit is contained in:
@ -7,6 +7,7 @@
|
||||
import argparse as ap
|
||||
import sys
|
||||
import json
|
||||
from os.path import exists
|
||||
|
||||
# Libraries for image processing
|
||||
import numpy as np
|
||||
@ -59,7 +60,11 @@ class apply_filters:
|
||||
self.output_file = self.args.output_file
|
||||
self.dpi = self.args.dpi
|
||||
self.mirror = True if self.args.mirror else False
|
||||
self.run()
|
||||
if exists(self.input_file):
|
||||
self.run()
|
||||
else:
|
||||
print("Input file does not exist", file=sys.stderr)
|
||||
exit(1)
|
||||
|
||||
def run(self):
|
||||
# read as numpy.array
|
||||
|
Reference in New Issue
Block a user