Should have been fixed with 0.4.3, please test. If the problem persists, you may also delete your account and add it again.
Contact photos are continuously degrading
It appears my most used contacts’ photos are loosing quality rapidly. I’m not sure what contacts exactly are affected but those marked as “favorites” definitely are as well as some I have recently edited.
They look like they have been saved with a very low JPEG quality-setting (or maybe just re-compressed multiple times?). I have not touched the photos themselves in months.
I’m using latest davdroid on Android 4.2, syncing with own Owncloud 7 instance.
Could you provide more information? I mean, do the contacts look fine in OwnCloud and bad on Android after syncing? What version of DAVdroid are you using? Did things work before but don’t now? Is there any reason to suspect DAVdroid is playing a role in this quality?
The contacts used to look fine on Android and in Owncloud. Now they look garbled on both. I recently switched from CardDAV to DAVdroid, so I suspected this might be the reason. But then again, I also recently updated Owncloud from 6.x to 7.0. Honestly, I’m just not sure where to look. It seems weird that Owncloud or DAVdroid would re-compress the photos at all during sync?
I’ve been using DAVdroid for a month or so with the latest version from play store respectively (currently 0.6.1).
If your contacts look bad in OwnCloud, then it’s very likely you have something bad happening with OwnCloud as opposed to DAVdroid.
What if you upload new versions now? Do they look good in the OwnCloud web interface? After you confirm that, sync them using DAVdroid and check both the OwnCloud web interface and your Android device. Do they look good there? If so, you might (correctly) assume there were some bugs with OwnCloud’s contact picture handling in 6.*, and perhaps (or perhaps not) those bugs were relevant.
When you say you switched “from CardDAV” I assume you mean some piece of Android software, such as “CardDAV-sync”. To be precise, the word “CardDAV” refers to a protocol, not a piece of software.
It seems weird that Owncloud or DAVdroid would re-compress the photos at all during sync?
DAVdroid won’t do anything with your photos, but the Android Contacts provider may do, and OwnCloud may do.
Please give us detailled steps to reproduce.
I encountered the very same problem: I updated davdroid to 0.6.2 and started to use the new feature to group contacts via VCard CATEGORIES (https://github.com/rfc2822/davdroid/releases/tag/v0.6.1). Once i sort a contact into a group (e.g. Favorites, like @tribut did) at my android device, davdroid starts to upload this contact again and again to my owncloud 7.0.1 server. And every time the quality of the contact photo become worse.
However, this does not happen, if i sort a contact into a group using the owncloud web interface.
@dirdi: Again, DAVdroid doesn’t ever process photos in any way (while your Calendar app or the Android Calendar Provider might do).
Can you please provide detailled steps to reproduce that demonstrate the issue? Otherwise, I’ll have to close this bug because I think it’s not DAVdroid-related.
I have the same problem (using owncloud 7.0) and a solution. After I have detected the continuously worsen of (new) contact pictures, I have found out that the affected contacts remain marked as “dirty” in the android backend. However, the “version” of the raw contact is continuously increasing. Hence, there must be a problem during the synchronization.
Indeed, the DAVdroid logs shows that there is an HTTP error 500 (internal server error) during the synchronization. The logs of my web server show the following error:
PHP Fatal error: Call to undefined method OCA\Contacts\VObject\VCard::getPhoto() in /usr/share/owncloud/apps/contacts/lib/utils/properties.php on line 314
This is a known issue in the owncloud project: owncloud/contacts#585
A (for me) working bugfix is already available: owncloud/contacts#598
After applying the bugfix (change two lines of code), the contacts are now synchronized correctly and are not marked as “dirty” anymore. Although I can prove for sure only in a few weeks, I think this is the solution for the degraded quality of the contact pictures. But please note, that you have to use a new picture for the contact after applying the patch.
@rfc2822: Although this particular error (synchronization is not finished) origins in owncloud, one could argue, that DAVdroid should not behave in this way, i.e. the continuously degrading of quality should not happen. However, I have not looked in the code to find out why the degrading happens and how to prevent it. But, maybe you can use the provided information in order to harden the error treatment of your app, if possible.
@korelstar’s solution fixed the issue for me, too!
I have found out that the affected contacts remain marked as “dirty” in the android backend.
So this is working as intented – when a contact can’t be uploaded, the DIRTY flag will not be removed so that it will be tried at the next sync run again.
However, the “version” of the raw contact is continuously increasing.
I’d need logs to say whether this is working is intended. In case that OwnCloud returns a 500, but changes the ETag of the contact, it’s correct that it will be downloaded again (maybe with other photo data). However, the DIRTY flag should be removed then.
@rfc2822: Although this particular error (synchronization is not finished) origins in owncloud, one could argue, that DAVdroid should not behave in this way, i.e. the continuously degrading of quality should not happen.
Indeed. Although DAVdroid – as already mention – doesn’t touch the image data itself.
However, I have not looked in the code to find out why the degrading happens and how to prevent it. But, maybe you can use the provided information in order to harden the error treatment of your app, if possible.
Without detailled logs, it’s impossible for me to track this issue.
A detailed log can now be found under http://daten.korelstar.de/unsortiert/davdroid-owncloud.log.txt
I will delete it later.
Was this fixed in OwnCloud? I vaguely recall reading about it there a while back.
Yes, it is fixed in ownCloud by owncloud/contacts#598 (master branch) and owncloud/contacts#681 (stable7 branch). However, the fix is not included in the current stable release 7.0.2. But it should be included in the next release 7.0.3 and a future ownCloud 8.
I am also noticing this with Baikal and DavDroid. I think its Android’s contact provider that compresses images further every time a contact is updated.
I have put something on CM’s JIRA. Whether it’ll fix the issue or not I don’t know. If no-one picks it up at CM i’ll have to checkout the whole of CM and try and see if I can adjust the contact providers behaviour myself
I think this should be closed, it’s an ownCloud issue (which I also used to experience before I switched away) that allegedly has been fixed.
Oh yes, sorry. Totally forgot about it.
@tribut : I do not agree on closing this issue. Indeed, this issue is caused by a bug in owncloud. However, it is not owncloud which degrades the contact photo’s quality – it is android/davdroid! (see the above discussion: https://github.com/bitfireAT/davdroid/issues/296#issuecomment-53894868)
Due to the bug in owncloud, davdroid receives a “500 Internal Server Error” from the server. At this point, there is a misbehavior on client side: The synchronization does not complete successfully, but the image data is nevertheless updated (this is the problem). In my opinion, davdroid should handle such a case in a more better way. Otherwise, this issue will come back again, if another server software produces another “500 Internal Server Error”.
A detailed davdroid log can still be found under http://daten.korelstar.de/unsortiert/davdroid-owncloud.log.txt
The degradation is not caused by DavDroid. I experienced this issue with CalDAV-Sync too.
I also experience the same problem using the latest owncloud and DavDroid. The source of the problem has already been found?