[sync] Turba contact photos not synced with Synthesis client
Thomas Trethan
thomas at trethan.net
Wed Oct 13 21:11:27 UTC 2010
Quoting Jan Schneider <jan at horde.org>
>
> Zitat von Thomas Trethan <thomas at trethan.net>:
>
>>
>>
>> After doing a lot of tests together with the Synthesis crew they
>> sent me the following explanation:
>>
>> 1) The Horde devInf is wrong. The correct type name is text/vcard,
>> as sent with the items (which have the correct type). But the
>> devInf shows text/directory, which is not correct.
>> (our client ignores that, this is not the main reason for the problem)
>>
>> 2) We decoded the sent photo information. All the sent photos are
>> completely corrupted and can't be displayed therefore. It looks like
>> a wrong conversion from ANSI to UTF-8, e.g. the type is something
>> like JFIF (not JPEG). So the server sends complete garbage within
>> the photo field.
>>
>> A real JPG starts with:
>>
>> FF D8 DD E0 00 10 4A
>>
>> What we get is:
>>
>> C3 BF C3 98 C3 BF C3 A0 00 10 4A
>>
>> The starting C3 BF is simply FF in UTF-8.
>>
>> Regards, Tom
>> Quoting sync-request at lists.horde.org:
>>
>>> Since Turba is sending the photo back to the client, it's got to be a
>>> client issue. Can you verify that the PHOTO attribute looks the same
>>> in both sync directions?
>>>
>>> Jan.
>>
>> --
>> sync mailing list - Join the hunt: http://horde.org/bounties/#sync
>> Frequently Asked Questions: http://horde.org/faq/
>> To unsubscribe, mail: sync-unsubscribe at lists.horde.org
>>
>
>
> Please create a ticket on http://bugs.horde.org/.
>
> Jan.
>
I created a ticket http://bugs.horde.org/ticket/9100
I finally found the reason for this behaviour and managed to implement a hack for solving it. The reason is, that all turba data is encoded utf-8 in the function tovCard() in lib/Driver.php. Photo and logo data should not be encoded, therefore I added the following code in line 1280 before the data gets base64 encoded:
$val = utf8_decode($val);
I know this is just a quick hack, but it works. Hopefully someday someone will implement a better solution. Since I'm not familiar with the Horde developement process (CVS, GIT, ...) yet maybe someone could add this line of code to the source meanwhile, thanks.
Regards, Tom
More information about the sync
mailing list