def resize_image(source_path, dest_path, size):
    image = Image.open(source_path)
image.thumbnail(size, Image.ANTIALIAS)
image.save(dest_path, 'JPEG')
source_image = pyexiv2.Image(source_path)
source_image.readMetadata()
dest_image = pyexiv2.Image(dest_path)
dest_image.readMetadata()
source_image.copyMetadataTo(dest_image)
dest_image['Exif.Photo.PixelXDimension'] = image.size[0]
dest_image['Exif.Photo.PixelYDimension'] = image.size[1]
dest_image.writeMetadata()
resize_image('41965749.jpg', 'resized.jpg', (600, 400))
Resize image in Python without losing EXIF data