--- \old\flickr.inc	Mon Jan 05 02:17:23 2009
+++ \new\flickr.inc	Thu Mar 19 12:56:34 2009
@@ -145,6 +145,25 @@ function emimage_flickr_data($field, $it
       $data['tags'][] = $tag['raw'];
     }
   }
+    
+  // Store the dimensions of the largest image so we can scale it correctly at display-time
+  $width = 0 ;
+  $height = 0;
+  $xml = emimage_flickr_request('flickr.photos.getSizes', array('photo_id' => $item['value']));
+  foreach( $xml["sizes"]["size"] as $size){
+    // Ignore the Square size, as that doesn't give us the true aspect ratio
+    if ($size["label"] != "Square") {
+      if ( (int)$size["width"] > $width ) {
+        $width = (int)$size["width"];
+        $height = (int)$size["height"];
+      }
+    }
+  }
+  if ($width > 0) {
+    $data['width'] = $width ;
+    $data['height'] = $height ;
+  }
+  
   return $data;
 }
 
