Its been asked a lot of times how to resize an image and keep the existing exif data. I'm able to do that easily with PIL:
from PIL import Image
im = Image.open("image.jpeg")
exif = im.info['exif']
# process the image, for example resize:
im_resized = im.resize((1920, 1080), resample=PIL.Image.LANCZOS)
im_resized.save("resized.jpeg", quality=70, exif=exif)
I was wondering is there a way to keep the XMP metadata from the original image? There's a lot of GPS data in the XMP which I would love to keep in the resized version.