[Vobject] Photo embedding with VObject, python 2.7

Adam Tauno Williams awilliam at opengroupware.us
Fri Oct 28 05:51:05 CDT 2016


On Fri, 2016-10-28 at 06:34 -0400, Adam Tauno Williams wrote:
> On Thu, 2016-10-27 at 14:34 -0400, Yanilda Peralta wrote:
> > 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.
> It works for me with -
>   x = card.add('photo')
>   x.encoding_param = "b"
>   x.type_param = 'JPEG'
>   scratch_file.seek(0)  # contains a JPEG image
>   x.value = scratch_file.read()
> The above works in Python 2.6 & 2.7

Produces -

N:Williams;Adam;;;
PHOTO;TYPE=JPEG;ENCODING=b:/9j/4AAQSkZJRgABAQAA.....


-- 
Adam Tauno Williams <mailto:awilliam at whitemice.org> GPG D95ED383
OpenGroupware Developer <http://www.opengroupware.us/>




More information about the VObject mailing list