[Vobject] Photo embedding with VObject, python 2.7
yanilda.peralta at gmail.com
Fri Oct 28 09:21:44 CDT 2016
Thank you so much for your time,
After trying your snippet it produces the same output that you post,
however when I open the vcard that I write to a file, the photo doesn't
show any photo I don't know why.
This is what I try:
x = card.add('photo')
x.type_param = 'JPEG'
x.value = base64.encodestring(photo_1.read())
out = open(filename, 'a')
On Fri, Oct 28, 2016 at 6:51 AM, Adam Tauno Williams <
awilliam at opengroupware.us> wrote:
> 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 -
> Adam Tauno Williams <mailto:awilliam at whitemice.org> GPG D95ED383
> OpenGroupware Developer <http://www.opengroupware.us/>
> VObject mailing list
> VObject at lists.skyhouseconsulting.com
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the VObject