catch more specific errors
This commit is contained in:
@@ -14,7 +14,7 @@ def main(args):
|
||||
# read the image once for check, as some images may have errors
|
||||
try:
|
||||
img = cv2.imread(img_path)
|
||||
except Exception as error:
|
||||
except (IOError, OSError) as error:
|
||||
print(f'Read {img_path} error: {error}')
|
||||
status = False
|
||||
if img is None:
|
||||
|
||||
Reference in New Issue
Block a user