在 Windows 通讯录中显示 vCard 照片 [英] Displaying vCard photos in Windows Contacts

查看:32
本文介绍了在 Windows 通讯录中显示 vCard 照片的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 vCard 2.1 之后,我将照片添加到 vCard.我正在对从 URL 获取的图像进行编码,然后将编码后的值添加到 vCard 中的适当位置.这似乎可以为所有可以打开电子名片的程序正确显示照片,除了 Windows 7 上的 Windows 联系人程序(可能也不适用于较新版本的 Windows).

据我所知,在 Windows 通讯录中打开时,以下代码段应显示 vcard 照片:

BEGIN:VCARD版本:2.1N;CHARSET=ISO-8859-1:Lastname;Firstname;FN;CHARSET=ISO-8859-1:Firstname 姓氏ORG;CHARSET=ISO-8859-1:组织 LLPPHOTO;ENCODING=b;TYPE=jpg:<base64 编码的图像为一行>标题;字符集=ISO-8859-1:位置电话;工作;语音:+1 999 999 9999结束:电子卡

Windows 通讯录中会显示所有其他信息,但不会显示照片.显示标准空白图像占位符.

我试过了

  • ENCODING=BASE64
  • 完全省略 ENCODING 关键字
  • 完全删除 TYPE 关键字
  • 专门使用 240 像素 x 240 像素的图片
  • 在文件中添加图像 URL 值而不是编码值

有人有什么想法吗?

解决方案

我在研究这个问题时遇到了你的帖子,我能够成功找到实现这一目标的正确方法.

Bellow 是一个包含 96x96 嵌入 red.gif 图像作为照片的 v-card 的自包含示例.

Following vCard 2.1, I'm adding photos to vCards. I'm encoding the image fetched from a URL, then adding the encoded value to the proper place within the vCard. This seemingly displays the photo correctly for all programs that can open vCards except the Windows Contacts program on Windows 7 (probably doesn't work for newer versions of Windows either).

As far as I can tell, the below snippet should display the vcard photo when opened in Windows Contacts:

BEGIN:VCARD
VERSION:2.1
N;CHARSET=ISO-8859-1:Lastname;Firstname;
FN;CHARSET=ISO-8859-1:Firstname Lastname
ORG;CHARSET=ISO-8859-1: Organization LLP
PHOTO;ENCODING=b;TYPE=jpg: <base64 encoded image as one line>
TITLE;CHARSET=ISO-8859-1:Position
TEL;WORK;VOICE:+1 999 999 9999
END:VCARD

All the other information displays in Windows Contacts, but not the photo. The standard blank image placeholder displays.

I have tried

  • ENCODING=BASE64
  • ommitting the ENCODING keyword altogether
  • removing the TYPE keyword altogether
  • using specifically a 240px by 240px image
  • adding the image URL value in the file instead of the encoded value

Anyone have any ideas?

解决方案

I've run into your post while researching this question and I was able to successfully find the correct way to achieve this.

Bellow is a self-containing example of a v-card containing an 96x96 embedded red.gif image as the PHOTO.

https://tools.ietf.org/html/rfc2426#section-3.1.4

Be sure to note the VERSION line and the PHOTO line. This is currently working in Outlook365.

BEGIN:VCARD
VERSION:3.0
N:Gump;Forrest;;Mr.;
FN:Forrest Gump
ORG:Bubba Gump Shrimp Co.
TITLE:Shrimp Man
PHOTO;ENCODING=BASE64;TYPE=GIF:R0lGODdhYABgAPAAALccHMlFJiH5BAEAAAEALAAAAABgAGAAAAJuhI+py+0Po5y02ouz3rz7D4biSJbmiabqyrbuC8fyTNf2jef6zvf+DwwKh8Si8YhMKpfMpvMJjUqn1Kr1is1qt9yu9wsOi8fksvmMTqvX7Lb7DY/L5/S6/Y7P6/f8vv8PGCg4SFhoeIiYqLiIUgAAOw==
TEL;TYPE=work,voice;VALUE=uri:tel:+1-111-555-1212
TEL;TYPE=home,voice;VALUE=uri:tel:+1-404-555-1212
ADR;TYPE=WORK;PREF=1;LABEL="100 Waters Edge\nBaytown\, LA 30314\nUnited States of America":;;100 Waters Edge;Baytown;LA;30314;United States of America
ADR;TYPE=HOME;LABEL="42 Plantation St.\nBaytown\, LA 30314\nUnited States of America":;;42 Plantation St.;Baytown;LA;30314;United States of America
EMAIL:forrestgump@example.com
REV:20080424T195243Z
x-qq:21588891
END:VCARD

这篇关于在 Windows 通讯录中显示 vCard 照片的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆