From b5a1fe643fb66acc0770b8c74a9166de647d19c0 Mon Sep 17 00:00:00 2001 From: LDOUBLEV Date: Tue, 28 Jul 2020 11:29:55 +0800 Subject: [PATCH] if gif is None, return --- ppocr/utils/utility.py | 1 + 1 file changed, 1 insertion(+) diff --git a/ppocr/utils/utility.py b/ppocr/utils/utility.py index 05b788c4..a196e149 100755 --- a/ppocr/utils/utility.py +++ b/ppocr/utils/utility.py @@ -82,6 +82,7 @@ def check_and_read_gif(img_path): ret, frame = gif.read() if not ret: logging.info("Cannot read {}. This gif image maybe corrupted.") + return None, False if len(frame.shape) == 2 or frame.shape[-1] == 1: frame = cv2.cvtColor(frame, cv2.COLOR_GRAY2RGB) imgvalue = frame[:, :, ::-1] -- GitLab