Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Export VCF image to JPEG

I have created a .vcf contact with an iPhone and sent the file to myself in email. In that .vcf, I took a photo which is directly saved in the vCard, not in the phone's memory.

In the source of the .vcf, there is a code part starting like this:

PHOTO;ENCODING=b;TYPE=JPEG:/9j/4AAQSkZJRgABAQAAAQABAAD/4QBYRXhpZgAATU0AKgAA

And it continues on... Now, I would like to get this photo and save it as a .JPEG. Any ideas how to do that?

Thanks.

like image 729
pentzzsolt Avatar asked Mar 10 '13 21:03

pentzzsolt


People also ask

What is a VCF file and how do I open it?

Because VCF files are plain text files, you can open and examine them using any text editor, such as Microsoft Notepad (Windows), Apple TextEdit (Mac), or GitHub Atom (cross-platform).

Can a VCF file be printed?

It is easy to use, With just a few clicks, you can get the converted file, and View / Print a VCF file from your browser directly. You can open a VCF file from local computer, Google Drive, Dropbox, and Box. A VCF file is a standard file format for storing contact information for a person or business.


2 Answers

In macOS, it easy to to from the line command with "vi" and "base64.

For example,

Export the "Apple Inc." contact that comes with every user account.

  1. Use vi to manually remove the other lines.
  2. Remove the heading and the meta-data for that line

PHOTO;ENCODING=b;TYPE=JPEG:

  1. base64 decode the remaining file

# base64 -D -i Apple\ Inc..vcf -o Apple_Logo.jpeg

like image 168
benc Avatar answered Sep 27 '22 21:09

benc


The encoding is Base64. You can find a tool for decoding online.

I can recommend Freeformatter.com's decoder, which lets you save as a binary file. You will then need to rename that file to photo.jpg.

like image 36
Kristian Avatar answered Sep 27 '22 21:09

Kristian