Thanks for the update! The fix will be contained in the next release.
OwnCloud doesn't understand VCARD PHOTO tag
-
It seems that there is a problem when syncing from android to a carddav server (in my case owncloud 8.1.1)
Steps to reproduce:
- Modified any contact and change the contact image.
- Sync in android
Result: Contact image is not shown on server and got lost from android’s adressbook
The other way:
- Modified any contact on owncloud server
- Sync in android
Result: Contact image is shown in android
I tried the same steps using “CardDAV-Sync free” by Marten Gajda and this was working. So it is not a problem of android itself
Then I compared both VCARDs and found the difference that may lead to this issue:
-
The working version using “CardDAV-Sync free” sends this as PHOTO tag:
PHOTO;TYPE=JPEG;VALUE=BINARY;ENCODING=B:/9j/4AAQSkZJ[... and some more data ...]
-
The DAVdroid version sends this as PHOTO tag which is not working:
PHOTO:data:image/jpeg;base64,/9j/4AAQSkZJ[... and some more data ...]
The base64 encoded images starts with “/9j”. This is the same in both variants. I pathed my owncloud instance to replace “PHOTO:data:image/jpeg;base64,” by “PHOTO;TYPE=JPEG;VALUE=BINARY;ENCODING=B:” and it worked. So could you please fix this in DAVdroid?
To test the new VCARD, you could use a onlien tool: http://www.proflogic.com/vCard/
SOFTWARE INFORMATION
DAVdroid version: 0.9.0.4 (82)
JB Workarund installed: noSYSTEM INFORMATION
Android version: 5.1.1
Device: samsung / GT-I8190 -
Are you talking about VCard 3 or VCard 4? The first
PHOTO
property you have posted is in the VCard 3 format, the second one in VCard 4 format.As far as I know, OwnCloud 8.1 advertises VCard 4 support, so it should actually accept VCards in VCard 4 format.
Could you please elaborate on why the property is “invalid”?
-
DAVdroid sends V3, not V4
BEGIN:VCARD VERSION:3.0 UID:fe2d9f14-741a-46d3-8eaf-7293b35dae84 PRODID:+//IDN bitfire.at//DAVdroid/0.9.0.4 vcard4android ez-vcard/0.9.6 FN:_test4 N:;_test4;;; PHOTO:data:image/jpeg;base64,/9j/4AAQSkZ[... and some more data ...]
-
@menzer said:
DAVdroid sends V3, not V4
BEGIN:VCARD
VERSION:3.0
UID:fe2d9f14-741a-46d3-8eaf-7293b35dae84
PRODID:+//IDN bitfire.at//DAVdroid/0.9.0.4 vcard4android ez-vcard/0.9.6
FN:_test4
N:;_test4;;;
PHOTO:data:image/jpeg;base64,/9j/4AAQSkZ[… and some more data …]That would indeed be a problem. Can you please provide verbose logs of the complete upload process?
Does your OwnCloud advertise VCard 4?
Are you sure that you got this “VCard 3” directly from DAVdroid (traffic logs) and not from OwnCloud?
-
For me, this sounds very similar to https://github.com/owncloud/contacts/issues/1072 and https://github.com/owncloud/contacts/pull/1054
-
Thanks for the tip regarding version 3.0 and 4.0. The complete trace DAVdroid write to SD-Card contains “VERSION:4.0”. Owncloud somehow falsly converts it to “VERSION:3.0” without converting the values properly. So this ticket can be closed. Thanks for your help.
P.S.: This is my oc workaround: https://github.com/s3menzer/contacts/commit/5e5a813f8eaff6a77dc2b2f9abb533a5f973a5db