未验证 提交 83d59c5d 编写于 作者: D Double_V 提交者: GitHub

Merge pull request #1685 from littletomatodonkey/dyg/fix_get_img

fix get image list
...@@ -57,7 +57,7 @@ def get_image_file_list(img_file): ...@@ -57,7 +57,7 @@ def get_image_file_list(img_file):
elif os.path.isdir(img_file): elif os.path.isdir(img_file):
for single_file in os.listdir(img_file): for single_file in os.listdir(img_file):
file_path = os.path.join(img_file, single_file) file_path = os.path.join(img_file, single_file)
if imghdr.what(file_path) in img_end: if os.path.isfile(file_path) and imghdr.what(file_path) in img_end:
imgs_lists.append(file_path) imgs_lists.append(file_path)
if len(imgs_lists) == 0: if len(imgs_lists) == 0:
raise Exception("not found any img file in {}".format(img_file)) raise Exception("not found any img file in {}".format(img_file))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册