CardDavMate, upload of contact photos



  • Hi, thanks for the really great product. But currently I have a problem with contact photos which are uploaded to the CalDav-Server via CardDavMate.
    CardDavMate resize every new photo via Canvas and save it as PNG. When I am now sync this vcard with DAVDroid on my Android, everything is visible. Only the contact photo is missing.

    Device: Nexus 5
    Android: 6.0
    DavDroid: 0.9.0.4 (Google Play Store)
    CardDav-Server: Baikal 0.2.7
    CardDavMate: 0.13.1

    Here some debug information from DavDroid.

    [trace] BEGIN:VCARD
    [trace] VERSION:3.0
    [trace] UID:326ygepw-vywd-lqhi-jhpl-n57chiws9w88
    [trace] FN:Name1 Name2
    [trace] REV:20151030T194406Z
    [trace] BDAY;VALUE=date:2012-04-05
    [trace] PHOTO;ENCODING=b;TYPE=png:data:image/png;base64,iVBOR[... some data ...]
    [trace] item0.ADR;TYPE=HOME:;;Street 1;City;;1234;Austria
    [trace] item0.X-ABADR:at
    [trace] PRODID:-//Inf-IT//CardDavMATE 0.13.1//EN
    [trace] END:VCARD
    [trace] <-- END HTTP (166540-byte body)
    [info ] Updating 84d2ad18e7dc8b2a3e179b9dfc83abadb3f04940605db2063acd12888f4e5b7a.vcf in local address book
    [info ] Saving sync state
    [info ] Saving CTag=76
    

  • developer

    Hi,

    Thanks for your report. Probably this is because of the image type (PNG), but I don't know.

    Can you please give detailed steps to reproduce? Can you provide a test account, because I don't have CardDavMate?



  • Yes, how can I send you the details (username, password, server urls, ...) - I send you the details per chat.

    Steps:

    • Create an contact over CardDavMate, or use a exist contact.
    • Add a JPEG photo via CardDavMate to the contact. (Mark the contact, click "Edit" and then click on the photo of the contact)
    • Synchronize the new contact via DavDroid to Android.

  • developer

    @fanningert said:

    Yes, how can I send you the details (username, password, server urls, ...) - I send you the details per chat.

    Steps:

    • Create an contact over CardDavMate, or use a exist contact.
    • Add a JPEG photo via CardDavMate to the contact. (Mark the contact, click "Edit" and then click on the photo of the contact)
    • Synchronize the new contact via DavDroid to Android.

    Thanks. Just send it in the chat, please (click on my user profile, then chat)



  • Details are in the chat.


  • developer

    I think (although I have no prove yet) the reason is that CardDavMate sends all images in PNG format.

    1. This makes images (especially photos) really big, and there are IPC-induced size limitations in what DAVdroid can put into the PHOTO blob.
    2. It seems like BitmapFactory which is used to inflate the image can't process this specific image, or images from CardDavMate, or PNG images in general.

    If my assumption is true, then this is an incompatibility between CardDavMate (sending PNG images) and Android (not be able to process these PNG images). The VCard 3 RFC doesn't say anything about which image formats have to be supported.

    Do you know why CardDavMate sends photos as a PNG? Although it's of course a valid choice, JPEG makes much more sense in my opinion (takes far less space, especially for photos). For logos, PNG may be a a better choice.



  • I think the PNG is the default ouput format, when you resize an image on client side via canvas.
    Thanks for your analyse, I will send an email to the creators of CardDavMate.



  • @rfc2822 It is a bug in CardDavMATE. the next release will have the fix.

    Here the email from the developer (support).

    there is a bug in the current version of CardDavMATE what may be related to your problem.
    There is also a fix for it available at:

    https://www.inf-it.com/mlmmj/davclients/2015-09/0000067.html

    Please try the patch (and do not forget to execute the ./cache_update.sh), add a new image into
    a contact and let me know the result. Please also double check whether your browser downloads
    the modified data_process.js file (most of users ignore the .htaccess configuration files and then
    the browser uses the previous version of file - see the following thread if your browser not downloads
    the modified data_process.js: https://www.inf-it.com/mlmmj/davclients/2015-10/0000013.html)


  • developer

    @fanningert Indeed, I didn't notice that

    PHOTO;ENCODING=b;TYPE=png:data:image/png;base64,iVBOR[... some data ...]
    

    isn't a valid VCard 3 PHOTO property (could have told that from the logs).

    I hope that this will be fixed with the CardDavMate update. Could you already test it?



  • @rfc2822 Yes, I test the fix (diff of the linked post) and it works. But I also made a feature request to the activate automatic resize function. So we can close the issue in this forum.

    https://www.inf-it.com/fixes/photo_attr_fix.diff


  • developer

    @fanningert said:

    @rfc2822 Yes, I test the fix (diff of the linked post) and it works. But I also made a feature request to the activate automatic resize function. So we can close the issue in this forum.

    Ok, thanks. There are (by intention) no issues here, as this is just a forum, but I will set the "solved" tag (you can set tags yourself by editing the original posting).



Looks like your connection to Bitfire App Forums was lost, please wait while we try to reconnect.