<div dir="ltr">Thank you so much for your time, <div>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.<br></div><div><br></div><div><br></div><div>This is what I try:</div><div><br></div><div><div>photo_1=open('photo.jpg','rb')</div><div>x = card.add('photo')</div><div>x.type_param = 'JPEG'</div><div>photo_1.seek(0)</div><div>x.value = base64.encodestring(photo_1.read())</div><div><br></div><div>filename= 'file.vcf'</div><div><br></div><div>out = open(filename, 'a')</div><div>out.write(card.serialize().encode('utf-8'))</div><div>out.close()</div></div><div><br></div><div>output:</div><div><br><div><div>BEGIN:VCARD</div><div><br></div><div>VERSION:3.0</div><div>.</div><div>FN:SD</div><div><br></div><div>N:D;S;;;</div><div><br></div><div>PHOTO;TYPE=JPEG:/9j/4AAQSkZJRgABAQEAwAD.....</div></div><div><br></div><div><br></div><div><br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Oct 28, 2016 at 6:51 AM, Adam Tauno Williams <span dir="ltr"><<a href="mailto:awilliam@opengroupware.us" target="_blank">awilliam@opengroupware.us</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Fri, 2016-10-28 at 06:34 -0400, Adam Tauno Williams wrote:<br>
> On Thu, 2016-10-27 at 14:34 -0400, Yanilda Peralta wrote:<br>
> > Hi, I've tried different snippets to get the the photo embedded on<br>
> > the vcard object but It doesn't seem to be working in any ways.<br>
> It works for me with -<br>
> x = card.add('photo')<br>
> x.encoding_param = "b"<br>
> x.type_param = 'JPEG'<br>
> scratch_file.seek(0) # contains a JPEG image<br>
> x.value = scratch_file.read()<br>
> The above works in Python 2.6 & 2.7<br>
<br>
</span>Produces -<br>
<br>
N:Williams;Adam;;;<br>
PHOTO;TYPE=JPEG;ENCODING=b:/<wbr>9j/4AAQSkZJRgABAQAA.....<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
--<br>
Adam Tauno Williams <mailto:<a href="mailto:awilliam@whitemice.org">awilliam@whitemice.org</a><wbr>> GPG D95ED383<br>
OpenGroupware Developer <<a href="http://www.opengroupware.us/" rel="noreferrer" target="_blank">http://www.opengroupware.us/</a>><br>
<br>
<br>
______________________________<wbr>_________________<br>
VObject mailing list<br>
<a href="mailto:VObject@lists.skyhouseconsulting.com">VObject@lists.<wbr>skyhouseconsulting.com</a><br>
<a href="http://lists.skyhouseconsulting.com/mailman/listinfo/vobject" rel="noreferrer" target="_blank">http://lists.<wbr>skyhouseconsulting.com/<wbr>mailman/listinfo/vobject</a><br>
</div></div></blockquote></div><br></div>