Index: gmail-contacts-to-vcf.py
===================================================================
--- gmail-contacts-to-vcf.py	(revision d473bae911978aba0df0cde0cd5c7df72f194bc8)
+++ gmail-contacts-to-vcf.py	(revision fc7bbfc586ab1939736035b2603586e4312d5be2)
@@ -39,5 +39,5 @@
 class Contacts(object):
 
-    def __init__(self, email, password):
+    def __init__(self, email, password, picsdir=None):
         """
         Takes an email and password corresponding to a gmail account to
@@ -53,4 +53,7 @@
         self.groups = {}
         self.maingroup = None
+        self.picsdir = picsdir
+        if self.picsdir and not os.path.exists(self.picsdir):
+            os.makedirs(self.picsdir)
 
 
@@ -173,6 +176,8 @@
                 contact.photo.encoding_param = "b"
                 contact.photo.type_param = "image/jpeg"
-            #with open("%s.jpg" % entry.title.text, "w") as img:
-            #    img.write(hosted_image_binary)
+            if self.picsdir:
+                with open(os.path.join(self.picsdir,
+                          "%s.jpg" % entry.title.text), "w") as img:
+                    img.write(hosted_image_binary)
 
         # IM
@@ -223,4 +228,5 @@
     parser.add_option("-p", "--password")
     parser.add_option("-f", "--filename", help="VCard file to write to")
+    parser.add_option("--pics", help="dump contact pictures in this folder")
     opts, args = parser.parse_args()
     while not opts.user:
@@ -240,5 +246,5 @@
 
     try:
-        contacts = Contacts(opts.user, opts.password)
+        contacts = Contacts(opts.user, opts.password, opts.pics)
     except gdata.service.BadAuthentication:
         print 'Invalid user credentials given.'
