enesser / vCards-js

Create vCards to import contacts into Outlook, iOS, Mac OS, and Android devices from your website or application.
MIT License
419 stars 154 forks source link

Adds support for embedded base64 images from local files #2

Closed mplno closed 9 years ago

mplno commented 9 years ago

Hi @enesser - I came across this module and found it really useful. I completed the getPhoto.embedFromFile method. It seems like a base64 string is the preferred way to embed images in a vCard, so that's what I've used here.

I tested with .bmp, .jpg, .jpf, .png, .gif images across the 2.1, 3.0 and 4.0 specs. They work great on iOS and OSX contacts. Google doesn't seems to support images in vCard 4.0, but the image populates in Google for a 3.0 vCard.

It might be worth warning users to resize images to around 150px or smaller. More pixels means a longer string representation and a really bloated .vcf file.

enesser commented 9 years ago

Thanks so much!