From 6e3b1d7ddc17659435e93f3d62739b25383770b8 Mon Sep 17 00:00:00 2001 From: Dawn_Ocean <1785590531@qq.com> Date: Sun, 22 Oct 2023 20:08:09 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BA=86.png=E7=AD=89?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E7=9A=84=E5=A4=A7=E5=B0=8F=E5=86=99=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/main.py b/main.py index 1e99b0f..b9706ef 100644 --- a/main.py +++ b/main.py @@ -29,6 +29,7 @@ def convert_all(path = os.path.abspath('.')): def convert_img(path = os.path.abspath('.')): files = os.listdir(path) for file in files: + file = file.lower() # 排除 .PNG 等带来的问题 if file.endswith('.pdf'): result = pdf2img(path, file) if result: # 1 -> Error @@ -52,7 +53,7 @@ def gen_filelist(path = os.path.abspath('.')): png_count = 0 dir_file_copy = copy(dir_file) for file in dir_file_copy: - if ".png" in file: + if ".png" in file.lower(): png_count += 1 else: dir_file.remove(file)