nextcloud / nextcloud/contacts
Contact photo won't show up, when VCF mime type "data:image/JPEG" stored in upper case, but will appear on "data:image/jpeg"
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 642
- Forks
- 220
- Avg merge
- 14h 39m
- Merged PRs (30d)
- 51
Description
Describe the bug
Syncing contacts with various programs like Thunderbird, Davx5, etc back and forth is the most common practice.
Some apps seem to sync the mime type in upper case, but I don't know which ones do. (Also see "Additional info")
So I think it's worth mentioning that contact photos will not show up in the Nextcloud contacts app, when the mime type in the URI-part of the PHOTO section is stored in upper case like this:
(This is only happening for VCARD 4.0 contacts)
PHOTO;VALUE=URI:data:image/JPEG;base64,/9j/4AAQ ...
However it will show up, when the stored URI-part looks like this ("jpeg" written in lower case):
PHOTO;VALUE=URI:data:image/jpeg;base64,/9j/4AAQ ...
Steps to reproduce
- Export all your contacts from Nextcloud contacts app as a single VCF file
- open the downloaded VCF file and check for entries with
PHOTO;VALUE=URI:data:image/JPEG;respecting upper case - Search for this/these contact/s in the Nextcloud contacts app and verify that the photo won't show up, although the contact has a photo that usually shows up in Thunderbird/CardBook-Addon, mobile phone contacts app and so on.
- Replace "data:image/JPEG" by "data:image/jpeg" in the VCF file
- Import your contacts again in Nextcloud contacts app and see that all contacts you're just changed now also will show a photo in the Nextcloud contacts app
Expected behavior
The contacts photos should always be visible although external contact programs may sync the mime type "data:image/JPEG" in upper case.
Actual behavior
The Nextcloud contacts app seems to differentiate whether "JPEG" after"data:image/" is stored in upper or lower case and won't show the photo when the URI part is stored in upper case.
Contact version
5.0.2
Operating system
Linux, NC 25.0.2
PHP engine version
PHP 8.1
Web server
Lighttpd
Database
MariaDB
Additional info
This issue might also show up when migrating contacts from VCARD 3.0 to VCARD 4.0.
Which might(?) happen during the transition
from VCARD 3.0 notation
PHOTO;ENCODING=b;TYPE=JPEG;VALUE=BINARY:/9j/4AAQ...
to VCARD 4.0 notation
PHOTO;VALUE=URI:data:image/JPEG;base64\,/9j/4AAQ...
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue does not name a file, test, or entry point. Trace how VCARD 4.0 PHOTO data URIs are imported and rendered, comparing handling of uppercase and lowercase JPEG MIME types. Done means a regression test or reproduction confirms that an uppercase data:image/JPEG photo is displayed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- web-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100