|
|
|
@ -18,7 +18,7 @@ def check_rate_xmps(pid): |
|
|
|
return False |
|
|
|
return False |
|
|
|
return True |
|
|
|
return True |
|
|
|
|
|
|
|
|
|
|
|
def clearExifAndRotate(imagePath, rotate=180): |
|
|
|
def clearExifAndRotate(imagePath, rotate=270): |
|
|
|
if os.path.exists(imagePath) == False: |
|
|
|
if os.path.exists(imagePath) == False: |
|
|
|
print(f'{time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())} {imagePath} 图片不存在') |
|
|
|
print(f'{time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())} {imagePath} 图片不存在') |
|
|
|
return |
|
|
|
return |
|
|
|
@ -37,7 +37,7 @@ def clearExifAndRotate(imagePath, rotate=180): |
|
|
|
with Image.open(imagePath) as img: |
|
|
|
with Image.open(imagePath) as img: |
|
|
|
# 使用RGB模式打开图像来丢弃可能存在的EXIF信息 |
|
|
|
# 使用RGB模式打开图像来丢弃可能存在的EXIF信息 |
|
|
|
img = img.convert("RGB") |
|
|
|
img = img.convert("RGB") |
|
|
|
img = img.rotate(180) |
|
|
|
img = img.rotate(rotate) |
|
|
|
# 保存图像,保存时不会带有原始的任何元数据 |
|
|
|
# 保存图像,保存时不会带有原始的任何元数据 |
|
|
|
img.save(imagePath, quality=100) # 对于JPEG,可以调整质量参数 |
|
|
|
img.save(imagePath, quality=100) # 对于JPEG,可以调整质量参数 |
|
|
|
|
|
|
|
|
|
|
|
|