I am trying to set up an installation of ejabberd 2.0.0 with openldap authentification. The vcard is based on the same openldap. Everything works fine except for the handling of the avatar.
The same configuration of openfire works perfectly (well, there are other problems, but not related to the avatar ;-), which is why i don't understand why it doesn't work with ejabberd.
The problem isn't due to a specific client, since I experience it on several clients with ejabberd, but not with openfire.
Here is what i get from ejabberd when requesting a vcard :
<iq to="arnouxt@lb205b.vinci.ec-lille.fr" type="get" id="81">
<vCard xmlns="vcard-temp" />
</iq>
<iq to="arnouxt@lb205b.vinci.ec-lille.fr/Gajim2" type="get" id="82">
<query xmlns="jabber:iq:version" />
</iq>
<iq from="arnouxt@lb205b.vinci.ec-lille.fr/Gajim2" to="arnouxt@im.ec-lille.fr/Gajim" id="80" type="result">
<query xmlns="jabber:iq:last" seconds="0"/>
</iq>
<iq from="arnouxt@lb205b.vinci.ec-lille.fr" to="arnouxt@im.ec-lille.fr/Gajim" id="81" type="result">
<vCard xmlns="vcard-temp">
<NICKNAME>vetetix</NICKNAME>
<FN>Thomas ARNOUX</FN>
<EMAIL>
<INTERNET/>
<PREF/>
<USERID>vetetix@gmail.com</USERID>
</EMAIL>
<BDAY>1985-03-24</BDAY>
<DESC>- Faire des fautes d'orthographe en parlant.
- Faire G1'...(arf, zut, c'est fait)...bon, ben redoubler une deuxième fois alors...
- Casser mon vélo ou mon ordi.</DESC>
<TEL>
<VOICE/>
<WORK/>
<NUMBER>06-85-24-87-05</NUMBER>
</TEL>
<PHOTO>
<BINVAL>Lzlq ... SC85az0=</BINVAL>
</PHOTO>
<N>
<FAMILY>ARNOUX</FAMILY>
<GIVEN>Thomas</GIVEN>
</N>
<ORG>
<ORGNAME>Ec Lille</ORGNAME>
<ORGUNIT>Promo 2009, E1</ORGUNIT>
</ORG>
<ADR>
<LOCALITY>Luxembourg/LUXEMBOURG</LOCALITY>
<STREET>196 rue de Kirchberg</STREET>
<PCODE>L-1858</PCODE>
</ADR>
</vCard>
</iq>
<iq from="arnouxt@lb205b.vinci.ec-lille.fr/Gajim2" to="arnouxt@im.ec-lille.fr/Gajim" id="82" type="result">
<query xmlns="jabber:iq:version">
<name>Gajim</name>
<version>0.11.4</version>
<os>Ubuntu</os>
</query>
</iq>
And her is what i get from openfire (the image should be the same, but clearly is different, and note that the type of the image is specified by openfire):
<iq to="arnouxt@im.ec-lille.fr/Gajim" type="get" id="83">
<query xmlns="jabber:iq:last" />
</iq>
<iq to="arnouxt@im.ec-lille.fr" type="get" id="84">
<vCard xmlns="vcard-temp" />
</iq>
<iq to="arnouxt@im.ec-lille.fr/Gajim" type="get" id="85">
<query xmlns="jabber:iq:version" />
</iq>
<iq from='arnouxt@im.ec-lille.fr' to='arnouxt@lb205b.vinci.ec-lille.fr/Gajim2' type='result' id='84'>
<vCard xmlns='vcard-temp'>
<N>
<GIVEN>vetetix</GIVEN>
</N>
<EMAIL>
<INTERNET/>
<USERID>vetetix@gmail.com</USERID>
</EMAIL>
<FN>Thomas ARNOUX</FN>
<NICKNAME>vetetix</NICKNAME>
<BDAY>1985-03-24</BDAY>
<PHOTO>
<TYPE>image/jpeg</TYPE>
<BINVAL>/9j/4AA ... UUAf/Z</BINVAL>
</PHOTO>
<ADR>
<HOME/>
<STREET>196 rue de Kirchberg</STREET>
<LOCALITY>Luxembourg/LUXEMBOURG</LOCALITY>
<PCODE>L-1858</PCODE>
</ADR>
<ADR>
<WORK/>
<STREET>Résidence Léonard de Vinci chambre b205b</STREET>
</ADR>
<TEL>
<HOME/>
<VOICE/>
<NUMBER>00-352-26-43-20-55</NUMBER>
</TEL>
<TEL>
<HOME/>
<CELL/>
<NUMBER>06-85-24-87-05</NUMBER>
</TEL>
<ORG>
<ORGUNIT>Promo 2009 Groupe E1</ORGUNIT>
</ORG>
</vCard>
</iq>
<iq from='arnouxt@im.ec-lille.fr/Gajim' to='arnouxt@lb205b.vinci.ec-lille.fr/Gajim2' id='83' type='result'>
<query xmlns='jabber:iq:last' seconds='0'/>
</iq>
<iq from='arnouxt@im.ec-lille.fr/Gajim' to='arnouxt@lb205b.vinci.ec-lille.fr/Gajim2' id='85' type='result'>
<query xmlns='jabber:iq:version'>
<name>Gajim</name>
<version>0.11.4</version>
<os>Ubuntu</os>
</query>
</iq>
Could someone help me please, i don't understand how ejabberd manages the image so that it isn't recognised by the clients. Is it a problem which can be dealt with in ejabberd, or maybe in the configuration of openldap ?
Its me again, but logged in
Its me again, but logged in this time.
The avatars are stored in base64 encoding in openldap, and not through a link to a file on the hard drive, could it be why there is a problem ?
ejabberd reencodes to base64
The avatars are stored in base64 encoding in openldap
Looking at ejabberd source code, when the file mod_vcard_ldap.erl is preparing the vcard to send to the client, it runs this:
It seems that ejabberd reencodes again the image.
You can try this modification:
Re: avatar not recognised by client
The avatars are stored in base64 encoding in openldap
Are you sure about that? It is a stupid idea to store binary data in base64 encoding in openldap.
Anyway, could you show the whole data in PHOTO element?
Recovered, check binvalues.txt
could you show the whole data in PHOTO element?
Vetetix provided the whole binary data in his original message. But I removed the binary content and left only a few characters because the text was completely unreadable.
I recovered the binary content from a backup, check the filebinvalues.txt .
Re: avatar not recognised by client
Right, the value is stored in base64, so, here is a problem: what happens if we will not encode the data with base64, but the data is stored in raw binary (not base64)? For example, my OpenLDAP stores avatars in raw binary.