forked from Dawn_Ocean/ZJUEVA-Reimburse
修复了.png等文件的大小写问题
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user