nextcloud / contacts

📇 Contacts app for Nextcloud
https://apps.nextcloud.com/apps/contacts
GNU Affero General Public License v3.0
563 stars 168 forks source link

Contact photo "PHOTO;ENCODING=B:" is not shown #3056

Open waclaw66 opened 1 year ago

waclaw66 commented 1 year ago

Describe the bug

Photo of following contact is not shown in NextCloud... 7346f7260c9cab20.zip

Google, Thunderbird and Roundcube show it correctly.

Steps to reproduce

  1. Import attached vcf file.
  2. View contact
  3. No photo shown, just obrazek

Expected behavior

Contact photo shall be shown.

Actual behavior

No contact photo shown.

Contact version

4.2.2

Operating system

Fedora 36

PHP engine version

PHP 8.1

Web server

Nginx

Database

MariaDB

Additional info

No response

nursoda commented 1 year ago

At first I thought that I experience the same issue. To verify, I exported two contacts that both have a PHOTO with ENCODING=B:… and imported those in another Nextcloud. In the first NC, only one of them (a JPEG) was shown, the WEBP wasn't. But in the other NC, both photos were shown. So, it seams that this is rather a "new imagemagick version" and/or "NC image caching" issue. Anyway, I deleted the contact where the photo wasn't shown, and re-importing it from the export (without any modification) did the trick for me. Shown fine now. Also note that both contact photos were shown in Thunderbird CardBook, even without the export-delete-re-import. (Contacts 5.0.2, Nextcloud 25.0.2, Arch Linux)

So, yes, there's an issue (with cached images), but there's a workaround, too. That should work for bulk export/import aswell.

waclaw66 commented 1 year ago

I don't think it's a caching problem, there is no <img> element inserted in avatar block...

<div data-v-4c5a24b3="" class="app-content-list-item-icon"><div data-v-9183f516="" data-v-4c5a24b3="" aria-label="Avatar of Home" class="avatardiv popovermenu-wrapper avatardiv--unknown" style="--size: 40px; line-height: 40px; font-size: 22px;"><!----> <!----> <!----> <div data-v-9183f516="" class="avatardiv__initials-wrapper" style="background-color: rgba(188, 92, 145, 0.1);"><div data-v-9183f516="" class="unknown" style="color: rgb(188, 92, 145);">
            H
        </div></div></div></div>

There is more likely a problem with vCARD photo parser, that vCARD file comes from Google Contacts that I have in sync with NextCloud. The problem persists on NextCloud 25.0.2 and Contacts 5.0.2.

nursoda commented 1 year ago

Hmmm. Unsure. Thing is: I just wanted to write that I agree since the webp profile photos of newly created contacts weren't shown. After doing something different and switching back to the browser, there I suddenly saw the photos (that initially only were initials). I probably clicked on another contact and back.

At first, I thought it might by that conversion to a different file format (probably would need imagemagick being installed) could be the reason, but right-clicking and saving the profile photo reveals that it's still the binary identical WEBP file (Header: RIFF|WEBPVP8L).

So, for my NC25 instance, it just took a while until it was displayed. Dunno why though.

pat-githubber commented 7 months ago

I have a similar issue to @waclaw66 reported description. When I add a photo to a Nextcloud Contact in Thunderbird, then the photo is visible in Thunderbird but not in Nextcloud using Firefox (v. 122.0 (64-bit))