解决句柄占用问题。
This commit is contained in:
@@ -77,9 +77,6 @@ def create_pdf_from_images(directory, output_pdf):
|
||||
# 创建图片列表
|
||||
image_list = []
|
||||
for image_file in image_files:
|
||||
# 使用Pillow获取图片尺寸
|
||||
with PILImage.open(image_file) as img:
|
||||
img_width, img_height = img.size
|
||||
|
||||
# 压缩图片到~300KB
|
||||
compressed_image_data = compress_image(image_file)
|
||||
|
||||
Reference in New Issue
Block a user