Merge remote-tracking branch 'origin/master'
# Conflicts: # ArticleReplaceBatch/images_edit.py # ArticleReplaceBatch/main_process_wtt.py
This commit is contained in:
commit
036eb90ca0
@ -145,9 +145,15 @@ def insert_images_into_paragraphs(paragraphs, image_folder, doc, title):
|
|||||||
:return:
|
:return:
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
if os.path.exists(image_folder):
|
||||||
|
images = sorted([os.path.join(image_folder, img) for img in os.listdir(image_folder) if
|
||||||
|
img.lower().endswith(('jpg'))])
|
||||||
|
else:
|
||||||
|
images = []
|
||||||
|
|
||||||
# 获取图片列表并排序
|
# 获取图片列表并排序
|
||||||
images = sorted([os.path.join(image_folder, img) for img in os.listdir(image_folder) if
|
# images = sorted([os.path.join(image_folder, img) for img in os.listdir(image_folder) if
|
||||||
img.lower().endswith(('jpg'))])
|
# img.lower().endswith(('jpg'))])
|
||||||
# images = sorted([os.path.join(image_folder, img) for img in os.listdir(image_folder) if
|
# images = sorted([os.path.join(image_folder, img) for img in os.listdir(image_folder) if
|
||||||
# # img.lower().endswith(('png', 'jpg', 'jpeg'))])
|
# # img.lower().endswith(('png', 'jpg', 'jpeg'))])
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user