diff options
-rw-r--r-- | src/components/ContactsList/ContactsListItem.vue | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/components/ContactsList/ContactsListItem.vue b/src/components/ContactsList/ContactsListItem.vue index 98043703..22f8b6b4 100644 --- a/src/components/ContactsList/ContactsListItem.vue +++ b/src/components/ContactsList/ContactsListItem.vue @@ -104,6 +104,12 @@ export default { }, avatarUrl() { if (this.contact.photo) { + const type = this.contact.vCard.getFirstProperty('photo').type + if (!this.contact.photo.startsWith('data') && type === 'binary') { + // split on coma in case of any leftover base64 data and retrieve last part + // usually we come to this part when the base64 image type is unknown + return `url(data:image;base64,${this.contact.photo.split(',').pop()})` + } return `url(${this.contact.photo})` } return `url(${this.contact.url}?photo)` |