Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
tree: 67efb19c46
Fetching contributors…

Cannot retrieve contributors at this time

23 lines (15 sloc) 0.462 kb
#!/usr/bin/ruby -w
require 'vpim/vcard'
vcf = open(ARGV[0] || 'data/vcf/Sam Roberts.vcf')
card = Vpim::Vcard.decode(vcf).first
card.photos.each_with_index do |photo, i|
file = "_photo_#{i}."
if photo.format
file += photo.format.gsub('/', '_')
else
# You are your own if PHOTO doesn't include a format. AddressBook.app
# exports TIFF, for example, but doesn't specify that.
file += 'tiff'
end
open(file, 'w').write photo.to_s
end
Jump to Line
Something went wrong with that request. Please try again.