Merger: fixes and better quality

This commit is contained in:
Colombo 2020-02-01 04:42:43 +04:00
parent 05f32d678d
commit b24b1e2950
4 changed files with 57 additions and 37 deletions

View file

@ -4,7 +4,7 @@ from pathlib import Path
from core.interact import interact as io
import traceback
def cv2_imread(filename, flags=cv2.IMREAD_UNCHANGED, loader_func=None):
def cv2_imread(filename, flags=cv2.IMREAD_UNCHANGED, loader_func=None, verbose=True):
"""
allows to open non-english characters path
"""
@ -17,7 +17,8 @@ def cv2_imread(filename, flags=cv2.IMREAD_UNCHANGED, loader_func=None):
numpyarray = np.asarray(bytes, dtype=np.uint8)
return cv2.imdecode(numpyarray, flags)
except:
io.log_err(f"Exception occured in cv2_imread : {traceback.format_exc()}")
if verbose:
io.log_err(f"Exception occured in cv2_imread : {traceback.format_exc()}")
return None
def cv2_imwrite(filename, img, *args):