diff -r 2c3e10482f47 usr/src/ShindigIntegrator/shindig_integrator/shindig_files/ShindigIntegratorDbFetcher.php
--- a/usr/src/ShindigIntegrator/shindig_integrator/shindig_files/ShindigIntegratorDbFetcher.php	Thu Jan 14 19:40:42 2010 +0100
+++ b/usr/src/ShindigIntegrator/shindig_integrator/shindig_files/ShindigIntegratorDbFetcher.php	Fri Jan 15 00:02:53 2010 +0100
@@ -121,7 +121,15 @@
 			$person->setDisplayName($user['profile_fname'] . ' ' . $user['profile_lname']);
 			$res = db_query("SELECT picture FROM {users} WHERE uid = %d",$id);	
 			$row =  db_fetch_array($res);
-			$person->setThumbnailUrl(! empty($row['picture']) ? $this->url_prefix.$row['picture'] : '');
+			$picture = $row['picture'];
+			if (empty($picture)) {
+			  $result = db_query('SELECT * FROM {variable} WHERE name = "%s"', 'user_picture_default');
+			  while ($variable = db_fetch_object($result)) {
+			    $variables[$variable->name] = unserialize($variable->value);
+			  }
+			  $picture = isset($variables['user_picture_default']) ? $variables['user_picture_default'] : '';
+			}
+			$person->setThumbnailUrl(! empty($picture) ? $this->url_prefix.$picture : '');
 			if ($user['profile_gender'] == 'Female') {
 			    $person->setGender('FEMALE');
 			} else {
diff -r 2c3e10482f47 usr/src/ShindigIntegrator/shindig_integrator/tests/thumbnail.test
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/usr/src/ShindigIntegrator/shindig_integrator/tests/thumbnail.test	Fri Jan 15 00:02:53 2010 +0100
@@ -0,0 +1,99 @@
+<?php
+
+// $Id$
+
+/**
+ * @file
+ * Tests ShindigIntegrator support for opensocial thumbnail.
+ *
+ */
+
+require_once(dirname(__FILE__) . '/../shindig/php/src/social/model/ComplexField.php');
+require_once(dirname(__FILE__) . '/../shindig/php/src/social/model/Person.php');
+require_once(dirname(__FILE__) . '/../shindig/php/src/social/model/Name.php');
+require_once(dirname(__FILE__) . '/../shindig/php/src/social/model/Address.php');
+global $TEST_ENABLED;
+$TEST_ENABLED = 1;
+require_once(dirname(__FILE__) . '/../shindig_files/ShindigIntegratorDbFetcher.php');
+
+class ShindigIntegratorThumbnailCase extends DrupalWebTestCase {
+
+  public static function getInfo() {
+    return array(
+      'name' => t('ShindigIntegrator Thumbnail test'),
+      'description' => t('Test ShindigIntegrator Thumbnail support.'),
+      'group' => t('ShindigIntegrator'),
+    );
+  }
+
+  function setUp() {
+    parent::setUp('profile', 'shindig_integrator');
+	db_query("INSERT IGNORE INTO `{profile_fields}` 
+			VALUES (1,'First name','profile_fname','','Personal information','','textfield',-4,0,0,4,0,''),
+			(2,'Last name','profile_lname','','Personal information','','textfield',-3,0,0,4,0,''),
+			(9,'Nickname','profile_nickname','','Personal information','','textfield',-10,1,0,2,0,''),
+			(4,'Date of Birth','profile_dob','','Personal information','','date',-8,0,0,2,0,''),
+			(5,'City','profile_city','','Personal information','','textfield',-7,0,0,2,0,''),
+			(10,'Country','profile_country','','Personal information','','selection',-6,0,0,2,0,'France\r\nGermany'),
+			(7,'Interested in','profile_interest','','Personal information','','textfield',-5,0,0,4,0,''),
+			(8,'Gender','profile_gender','','Personal information','','selection',-9,0,0,2,0,'Male\r\nFemale\r\nDon\'t Display\r\n')");
+	db_query("INSERT IGNORE INTO `{users}` 
+			VALUES (1,'proppy0010@proppy0010.com','6e70986ff6a7732342a37c9c45b39676','proppy0010@proppy0010.com',0,0,0,'','',1263486553,1263486795,1263486553,1,NULL,'','','proppy0010@proppy0010.com','a:4:{s:13:\"form_build_id\";s:37:\"form-e2d39a95fe9a566cc1bc6fac56623bff\";s:8:\"username\";s:25:\"proppy0010@proppy0010.com\";s:16:\"profile_nickname\";s:9:\"player260\";s:11:\"profile_dob\";a:3:{s:5:\"month\";s:1:\"1\";s:3:\"day\";s:2:\"14\";s:4:\"year\";s:4:\"2010\";}}')");
+  }
+
+  function test_no_thumbnail() {
+    $user = $this->drupalCreateUser(array('administer users'));
+    $profile = array();
+    $profile["profile_fname"] = "foo_fname";
+    $profile["profile_lname"] = "foo_lname";
+    $profile["profile_nickname"] = "foo_nickname";
+    $profile["profile_interest"] = "foo_interest";
+    $profile["profile_gender"] = "foo_gender";
+    profile_save_profile($profile, $user, "Personal information");
+    $uids = array();
+    $uids[] = $user->uid;
+    $fetcher = ShindigIntegratorDbFetcher::get();
+    $peoples = $fetcher->getPeople($uids, null, null);
+    $person = $peoples[$user->uid];
+    $thumbnail = $person->getThumbnailUrl();
+    $this->assertEqual('', $thumbnail);
+  }
+
+  function test_default_thumbnail() {
+    variable_set('user_picture_default', 'foo.png');
+    $user = $this->drupalCreateUser(array('administer users'));
+    $profile = array();
+    $profile["profile_fname"] = "foo_fname";
+    $profile["profile_lname"] = "foo_lname";
+    $profile["profile_nickname"] = "foo_nickname";
+    $profile["profile_interest"] = "foo_interest";
+    $profile["profile_gender"] = "foo_gender";
+    profile_save_profile($profile, $user, "Personal information");
+    $uids = array();
+    $uids[] = $user->uid;
+    $fetcher = ShindigIntegratorDbFetcher::get();
+    $peoples = $fetcher->getPeople($uids, null, null);
+    $person = $peoples[$user->uid];
+    $thumbnail = $person->getThumbnailUrl();
+    $this->assertTrue(strstr($thumbnail, 'foo.png'));
+  }
+
+  function test_thumbnail() {
+    $user = $this->drupalCreateUser(array('administer users'));
+    $profile = array();
+    $profile["profile_fname"] = "foo_fname";
+    $profile["profile_lname"] = "foo_lname";
+    $profile["profile_nickname"] = "foo_nickname";
+    $profile["profile_interest"] = "foo_interest";
+    $profile["profile_gender"] = "foo_gender";
+    profile_save_profile($profile, $user, "Personal information");
+    db_query("UPDATE {users} SET picture = '%s' WHERE uid = %d", "bar.png", $user->uid);
+    $uids = array();
+    $uids[] = $user->uid;
+    $fetcher = ShindigIntegratorDbFetcher::get();
+    $peoples = $fetcher->getPeople($uids, null, null);
+    $person = $peoples[$user->uid];
+    $thumbnail = $person->getThumbnailUrl();
+    $this->assertTrue(strstr($thumbnail, 'bar.png'));
+  }
+}
\ No newline at end of file
