1
This commit is contained in:
1 parent
f6ae9afe44
commit
0ec3ab5f09
1 file changed
+2
-2
@@ -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,可以调整质量参数
|
||||
|
||||
|
||||
Reference in new issue
Block a user