From 0ec3ab5f0928b047103f587527d2c30171f166a0 Mon Sep 17 00:00:00 2001 From: dongchangxi <458593490@qq.com> Date: Fri, 3 Jan 2025 16:02:43 +0800 Subject: [PATCH] 1 --- new_studio_to_reg/tools_to_xmps.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/new_studio_to_reg/tools_to_xmps.py b/new_studio_to_reg/tools_to_xmps.py index 81e83a5..5b3789a 100644 --- a/new_studio_to_reg/tools_to_xmps.py +++ b/new_studio_to_reg/tools_to_xmps.py @@ -18,7 +18,7 @@ def check_rate_xmps(pid): return False return True -def clearExifAndRotate(imagePath, rotate=180): +def clearExifAndRotate(imagePath, rotate=270): if os.path.exists(imagePath) == False: print(f'{time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())} {imagePath} 图片不存在') return @@ -37,7 +37,7 @@ def clearExifAndRotate(imagePath, rotate=180): with Image.open(imagePath) as img: # 使用RGB模式打开图像来丢弃可能存在的EXIF信息 img = img.convert("RGB") - img = img.rotate(180) + img = img.rotate(rotate) # 保存图像,保存时不会带有原始的任何元数据 img.save(imagePath, quality=100) # 对于JPEG,可以调整质量参数