From 3044f1fc082f6b8ce025f4bfd8ae5e44061289ce Mon Sep 17 00:00:00 2001 From: liuyebo <1515783401@qq.com> Date: Mon, 21 Oct 2024 09:32:39 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3heic=E5=9B=BE=E7=89=87?= =?UTF-8?q?=E4=BF=9D=E5=AD=98=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- util/image_util.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/util/image_util.py b/util/image_util.py index 4388dc1..8281be0 100644 --- a/util/image_util.py +++ b/util/image_util.py @@ -42,6 +42,8 @@ def split(img_path, ratio=1.414, overlap=0.05, x_compensation=3): wh_ratio = width / height img_name, img_ext = common_util.parse_save_path(img_path) + if img_ext == 'heic' or img_ext == 'HEIC': + img_ext = 'jpg' # cv2无法保存heic图片 if hw_ratio > ratio: # 纵向过长 new_img_height = width * ratio step = width * (ratio - overlap) # 偏移步长