when I try to resize(thumbnail) an image using PIL , it destroys the exif data associated with the image, How can I save it.
I resize the image and upload it to the cloud as image buffer.
file_path = '...'
file_name = '...'
im = Image.open( file_path )
size =(512,521)
im.thumbnail( size, Image.ANTIALIAS)
thumbnail_buf_string = StringIO.StringIO()
file_save_extension = 'JPEG'
im.save(thumbnail_buf_string, format=file_save_extension)
upload_to_cloud('512_' + file_name , thumbnail_buf_string.getvalue())
The resized image has no exif data.