[Vobject] Photo embedding with VObject, python 2.7
Yanilda Peralta
yanilda.peralta at gmail.com
Thu Oct 27 13:34:41 CDT 2016
Hi, I've tried different snippets to get the the photo embedded on the
vcard object but It doesn't seem to be working in any ways.
1
photo_fh=open('filepng','rb')
card.add('photo')
card.photo.value = photo_fh.read()
card.photo.type_param = "PNG"
2
photo_url = "http://example.com/img.png"
f = urllib.urlopen(photo_url)
data = f.read()
f.close()
vcard1.add('photo')
#vcard1.photo.type_param = "PNG"
#vcard1.photo.encoding_param="base64"
#vcard1.photo.value= base64.encodestring(data)
vcard1.photo.value=photo_url
But none has worked just yet,
any suggestions?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.skyhouseconsulting.com/pipermail/vobject/attachments/20161027/2177586f/attachment.html>
More information about the VObject
mailing list