? 20080812.session_login_without_cookie.patch
? 20080920.session_login_without_cookie.patch
? 20081016_drupalpost_cookie.patch
? simpletest-302075-20.patch
? simpletest-clearcookies.patch
? simpletest-clearcookies_0.patch
? simpletest-clearcookies_1.patch
? modules/simpletest/drupal_web_test_case.php.20090609
? sites/default/files
? sites/default/settings.php
Index: includes/image.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/image.inc,v
retrieving revision 1.33
diff -u -p -r1.33 image.inc
--- includes/image.inc	20 Apr 2009 20:02:30 -0000	1.33
+++ includes/image.inc	11 Jun 2009 19:29:28 -0000
@@ -101,10 +101,13 @@ function image_toolkit_invoke($method, s
 /**
  * Get details about an image.
  *
- * Drupal only supports GIF, JPG and PNG file formats.
+ * Drupal supports GIF, JPG and PNG file formats, and may support 
+ * additional formats if toolkits modules are installed.
  *
  * @param $filepath
  *   String specifying the path of the image file.
+ * @param $toolkit
+ *   An optional, image toolkit name to override the default.
  * @return
  *   FALSE, if the file could not be found or is not an image. Otherwise, a
  *   keyed array containing information about the image:
@@ -114,23 +117,24 @@ function image_toolkit_invoke($method, s
  *    'mime_type' - MIME type ('image/jpeg', 'image/gif', 'image/png').
  *    'file_size' - File size in bytes.
  */
-function image_get_info($filepath) {
+function image_get_info($filepath, $toolkit = FALSE) {
   if (!is_file($filepath)) {
     return FALSE;
   }
 
   $details = FALSE;
-  $data = @getimagesize($filepath);
-  $file_size = @filesize($filepath);
 
-  if (isset($data) && is_array($data)) {
-    $extensions = array('1' => 'gif', '2' => 'jpg', '3' => 'png');
-    $extension = array_key_exists($data[2], $extensions) ?  $extensions[$data[2]] : '';
-    $details = array('width'     => $data[0],
-                     'height'    => $data[1],
-                     'extension' => $extension,
-                     'file_size' => $file_size,
-                     'mime_type' => $data['mime']);
+  if (!$toolkit) {
+    $toolkit = image_get_toolkit();
+  }
+  if ($toolkit) {
+    $image = new stdClass();
+    $image->source = $filepath;
+    $image->toolkit = $toolkit;
+    $details = image_toolkit_invoke('get_info', $image);
+    if ($details) {
+      $details['file_size'] = @filesize($filepath);
+    }
   }
 
   return $details;
@@ -343,7 +347,7 @@ function image_load($file, $toolkit = FA
   if ($toolkit) {
     $image = new stdClass();
     $image->source = $file;
-    $image->info = image_get_info($file);
+    $image->info = image_get_info($file, $toolkit); 
     $image->toolkit = $toolkit;
     if (image_toolkit_invoke('load', $image)) {
       return $image;
@@ -374,7 +378,7 @@ function image_save(stdClass $image, $de
   if ($return = image_toolkit_invoke('save', $image, array($destination))) {
     // Clear the cached file size and refresh the image information.
     clearstatcache();
-    $image->info = image_get_info($destination);
+    $image->info = image_get_info($destination, $image->toolkit);
 
     if (drupal_chmod($destination)) {
       return $return;
Index: modules/system/image.gd.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/image.gd.inc,v
retrieving revision 1.6
diff -u -p -r1.6 image.gd.inc
--- modules/system/image.gd.inc	24 May 2009 17:39:34 -0000	1.6
+++ modules/system/image.gd.inc	11 Jun 2009 19:29:30 -0000
@@ -316,5 +316,36 @@ function image_gd_create_tmp(stdClass $i
 }
 
 /**
+ * Get details about an image.
+ *
+ * @param $image
+ *   An image object.
+ * @return
+ *   FALSE, if the file could not be found or is not an image. Otherwise, a
+ *   keyed array containing information about the image:
+ *    'width'     - Width, in pixels.
+ *    'height'    - Height, in pixels.
+ *    'extension' - Commonly used file extension for the image.
+ *    'mime_type' - MIME type ('image/jpeg', 'image/gif', 'image/png').
+ *
+ * @see image_get_info()
+ */
+function image_gd_get_info($image) {
+  $details = FALSE;
+  $data = @getimagesize($image->source);
+
+  if (isset($data) && is_array($data)) {
+    $extensions = array('1' => 'gif', '2' => 'jpg', '3' => 'png');
+    $extension = array_key_exists($data[2], $extensions) ?  $extensions[$data[2]] : '';
+    $details = array('width'     => $data[0],
+                     'height'    => $data[1],
+                     'extension' => $extension,
+                     'mime_type' => $data['mime']);
+  }
+
+  return $details;
+}
+
+/**
  * @} End of "ingroup image".
  */
