--- orig\Gallery2Flickr.class.php	2007-01-04 21:28:30.685001600 +0000
+++ new\Gallery2Flickr.class.php	2007-01-04 21:50:51.172528000 +0000
@@ -305,6 +305,39 @@
       return false;
     }
 
+    // get the comments for a photo
+    // TODO - need to skip this if the comment module isn't installed
+    GalleryCoreApi::requireOnce('modules/comment/classes/GalleryCommentHelper.class');
+    
+    list ($ret, $comments) =
+      GalleryCommentHelper::fetchComments($item->getId(), null, ORDER_ASCENDING)
+    if ($ret) {
+      return array($ret->wrap(__FILE__, __LINE__), null);
+    }
+
+    // an array of the users who left comments indexed by commenterId
+    $commenters = array();
+    if (!empty($comments)) {
+      for ($i = 0; $i < sizeof($comments); $i++) {
+	/* Get the commenter ids */
+	$commenters[$comments[$i]->getCommenterId()] = 1;
+      }
+
+      /* Load all the commenters user information */
+      if (sizeof($commenters) > 0) {
+        list ($ret, $commentersList) =
+          GalleryCoreApi::loadEntitiesById(array_keys($commenters));
+        if ($ret) {
+          return array($ret->wrap(__FILE__, __LINE__), null);
+        }
+      }
+
+      foreach ($commentersList as $commenter) {
+        $commenters[$commenter->getId()] = $commenter;
+      }
+    }
+    
+    
     $pid = $this->flickr->sync_upload ($path, 
 				       $item->getTitle(), 
 				       $item->getDescription(), 
@@ -318,6 +351,33 @@
     if (!$pid) {
       return false;
     }
+    				       
+    // set the photo comments in flickr
+    define("FLICKR_COMMENT_DELIMITER", " :: ");
+    if (!empty($comments)) {
+      for ($i = 0; $i < sizeof($comments); $i++) {
+        $currentComment = $comments[$i];
+
+        $flickrCommentText = "Gallery Comment" . FLICKR_COMMENT_DELIMITER;
+
+        if($commenters[$currentComment->getCommenterId()]->getFullName() != null) {
+          $flickrCommentText .= $commenters[$currentComment->getCommenterId()]->getFullName();
+        } else {
+	  $flickrCommentText .= $commenters[$currentComment->getCommenterId()]->getUserName();
+	}
+
+        if(null != $currentComment->getSubject()) {
+          $flickrCommentText .= FLICKR_COMMENT_DELIMITER . $currentComment->getSubject();
+	}
+	    
+	if(null != $currentComment->getComment()) {
+          $flickrCommentText .= FLICKR_COMMENT_DELIMITER . $currentComment->getComment();
+        }	    
+	    
+	// TODO error handling on result code
+	$result = $this->flickr->photos_comments_addComment($pid,$flickrCommentText);
+      }
+    }				    
     
     if (isset($set)) {
       $result = $this->flickr->photosets_addPhoto($set, $pid);
