dongchangxi 12 months ago
parent
commit
0ec3ab5f09
  1. 4
      new_studio_to_reg/tools_to_xmps.py

4
new_studio_to_reg/tools_to_xmps.py

@ -18,7 +18,7 @@ def check_rate_xmps(pid): @@ -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): @@ -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,可以调整质量参数

Loading…
Cancel
Save