FolkerKinzel / VCards

.NET library for reading, writing, and converting VCF files that comply with vCard standards 2.1, 3.0 and 4.0
MIT License
16 stars 5 forks source link

Photo information not readed #2

Closed denniskula closed 4 years ago

denniskula commented 4 years ago

Hi Folker,

your libary looks great but I have a problem with the photo. The attached file is a standard outlook contact file saved as *.vcf. Any idea how to solve this problem?

Max Anderer Mustermann sen.zip

FolkerKinzel commented 4 years ago

Hi Dennis,

thank you very much for posting this issue. I have published an update to Nuget, that should solve your problem.

I would recommend that you save your data in a newer vCard format (vCard 3.0 or 4.0). vCard 2.1 seems to me to be more of a poorly thought out recommendation than a real standard. Line folding in vCard 2.1 is made according to RFC 822: Lines are wrapped on places of linear whitespace and the whitespace at the beginning of a line is not removed. Thats a problem with Base64 encoded data (like photos) because there is no linear whitespace in it. I think the vCard 2.1 recommendation to add an empty line after Base64 encoded data should parsers enable to unfold the Base64 data. Outlook takes another way: It adds a space char at the beginning of every folded line of Base64 encoded data. How I mentioned above, this is not standard - nevertheless the library is now able to read this.

I would like to invite you to support this project: I have attached the content of your "Max Anderer Mustermann.vcf" file like it it's written by the library in vCard 2.1 and I am very interested to know, whether Outlook is able to parse the photo the way the library exports it (without space chars).

TestV2.1.vcf.zip

Please post another issue, if Outlook cannot read this.

FolkerKinzel commented 4 years ago

The issue is fixed with the latest update.