remotes/1693045480750635534/spooky-22
Aevann1 2022-01-23 19:54:57 +02:00
parent 334d0c417f
commit 869e171d00
1 changed files with 7 additions and 8 deletions

View File

@ -3,13 +3,6 @@ from webptools import gifwebp
import time
from PIL import Image
original_image = Image.open(filename)
fixed_image = ImageOps.exif_transpose(original_image)
def process_image(file=None, filename=None, resize=0):
if not filename: filename = f'/images/{time.time()}'.replace('.','')[:-5] + '.webp'
@ -21,7 +14,13 @@ def process_image(file=None, filename=None, resize=0):
else: i = IImage.open(filename)
except: return ""
i = ImageOps.exif_transpose(i)
exif = i.getexif()
for k in exif.keys():
if k != 0x0112:
exif[k] = None
del exif[k]
i.info["exif"] = exif.tobytes()
transposed = ImageOps.exif_transpose(i)
if resize:
size = resize, resize