解决句柄占用问题。

This commit is contained in:
liuwei
2025-05-26 10:10:23 +08:00
parent 3832997ac5
commit c0f839b71f

View File

@@ -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)