I have a function that takes an image and puts it in my contact vcf file as the profile photo. The problem is that the image is being shown rotated 90 degrees in my vcf file. I was suggested to clear all EXIF data but don`t really know how to implement this in my function down here.
def b64_image(filename):
response = urllib.request.urlopen("static/img/" + filename)
b64 = base64.b64encode(response.read())
return b64.decode('utf-8')
vcf_file_path = 'static/Contacto.vcf'
with open(vcf_file_path , 'w') as file_vcard:
vcard = vobject.vCard()
o = vcard.add('fn')
o.value = rowes.name
o = vcard.add('PHOTO;ENCODING=b;TYPE=image/jpeg')
o.type_param = 'PHOTO'
o.value = b64_image(rowr.img_url)
I've tried solutions in already asked questions but dont work in my case. Thanks in advance.