? 230029-duplicate-entry-vid-34.patch
? bad.patch
? batch-update-pass.txt
? bc-weight-73834-5.patch
? block_list_fix-232037-1.patch
? block_list_fix-232037-13.patch
? block_list_fix-232037-8.patch
? blog_tracker_access_bypass_2.patch
? book-admin-cleanup-276860-1.patch
? book-cid-276846-1.patch
? book_nodeapi_load.patch
? check-POST-222588-1.patch
? check-POST-222588-15.patch
? check-POST-222588-3.patch
? check-POST-222588-7x-15.patch
? check-POST-222588-8.patch
? clear-module-list-7x.patch
? created-270567-1.patch
? db-placeholders-sdo-409-6x-7a.patch
? delete-aggregator-blocks-268491-D7-5.patch
? fix-run-tests-243773-127.patch
? fix.patch
? form_markup.patch
? grant-op-278675-1.patch
? holey-cow-249546-1.patch
? image_toolkit_270508_22.patch
? image_toolkit_3.patch
? improve-script-254166-4.patch
? improve-script-254166-6.patch
? improve-script=more-254166-13.patch
? less-help-268006-1.patch
? lock-form-272900-2.patch
? lock-form-272900-6.patch
? make-plain-title-242873-45.patch
? make-plain-title-242873-50a.patch
? menu-attributes-isset.patch
? menu_rebuild_fix-261148.patch
? menu_rebuild_fix_0.patch
? mw_136.patch
? no-nest-form.patch
? node-type-namespace-206138-3.patch
? node-type-namespace-206138-8.patch
? not-anon-perms-248598-1.patch
? not-anon-perms-248598-2.patch
? perm-conversion-regex.txt
? perm_api_security.patch
? pluggable-passwords.patch
? preserve-link-class-273129-7.patch
? profile-test-quotes-252920-1.patch
? profile.test.patch
? remove-object-d7.patch
? result.html
? revert-251239-7x.patch
? router-delete-238760-46.patch
? router-delete-238760-53.patch
? simpletest-user-258200-11.patch
? system-test-setup-259871-1.patch
? system-test-setup.patch
? system_modules_cleanup-229129-8.patch
? test.php
? test3.php
? test4.php
? test5.php
? theme-allow-missing-css-d.patch
? toggle-cache-menu-231587.patch
? user-load-cache-91786-10.patch
? user-load-cache-91786-10b.patch
? user-load-cache-91786-8.patch
? user_permissions_3.patch
? writability-225880-31.patch
? writability-225880-32.patch
? xdebug.patch
? sites/all/modules
? sites/default/files
? sites/default/settings.php
Index: includes/image.gd.inc
===================================================================
RCS file: includes/image.gd.inc
diff -N includes/image.gd.inc
--- includes/image.gd.inc	14 Apr 2008 17:48:33 -0000	1.6
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,221 +0,0 @@
-<?php
-// $Id: image.gd.inc,v 1.6 2008/04/14 17:48:33 dries Exp $
-
-/**
- * @file
- * GD2 toolkit for image manipulation within Drupal.
- */
-
-/**
- * @ingroup image
- * @{
- */
-
-/**
- * Retrieve information about the toolkit.
- */
-function image_gd_info() {
-  return array('name' => 'gd', 'title' => t('GD2 image manipulation toolkit'));
-}
-
-/**
- * Retrieve settings for the GD2 toolkit.
- */
-function image_gd_settings() {
-  if (image_gd_check_settings()) {
-    $form = array();
-    $form['status'] = array(
-      '#value' => t('The GD toolkit is installed and working properly.')
-    );
-
-    $form['image_jpeg_quality'] = array(
-      '#type' => 'textfield',
-      '#title' => t('JPEG quality'),
-      '#description' => t('Define the image quality for JPEG manipulations. Ranges from 0 to 100. Higher values mean better image quality but bigger files.'),
-      '#size' => 10,
-      '#maxlength' => 3,
-      '#default_value' => variable_get('image_jpeg_quality', 75),
-      '#field_suffix' => t('%'),
-    );
-    $form['#element_validate'] = array('image_gd_settings_validate');
-
-    return $form;
-  }
-  else {
-    form_set_error('image_toolkit', t('The GD image toolkit requires that the GD module for PHP be installed and configured properly. For more information see <a href="@url">PHP\'s image documentation</a>.', array('@url' => 'http://php.net/image')));
-    return FALSE;
-  }
-}
-
-/**
- * Validate the submitted GD settings.
- */
-function image_gd_settings_validate($form, &$form_state) {
-  // Validate image quality range.
-  $value = $form_state['values']['image_jpeg_quality'];
-  if (!is_numeric($value) || $value < 0 || $value > 100) {
-    form_set_error('image_jpeg_quality', t('JPEG quality must be a number between 0 and 100.'));
-  }
-}
-
-/**
- * Verify GD2 settings (that the right version is actually installed).
- *
- * @return
- *   A boolean indicating if the GD toolkit is avaiable on this machine.
- */
-function image_gd_check_settings() {
-  if ($check = get_extension_funcs('gd')) {
-    if (in_array('imagegd2', $check)) {
-      // GD2 support is available.
-      return TRUE;
-    }
-  }
-  return FALSE;
-}
-
-/**
- * Scale an image to the specified size using GD.
- */
-function image_gd_resize($source, $destination, $width, $height) {
-  if (!file_exists($source)) {
-    return FALSE;
-  }
-
-  $info = image_get_info($source);
-  if (!$info) {
-    return FALSE;
-  }
-
-  $im = image_gd_open($source, $info['extension']);
-  if (!$im) {
-    return FALSE;
-  }
-
-  $res = imagecreatetruecolor($width, $height);
-  if ($info['extension'] == 'png') {
-    $transparency = imagecolorallocatealpha($res, 0, 0, 0, 127);
-    imagealphablending($res, FALSE);
-    imagefilledrectangle($res, 0, 0, $width, $height, $transparency);
-    imagealphablending($res, TRUE);
-    imagesavealpha($res, TRUE);
-  }
-  elseif ($info['extension'] == 'gif') {
-    // If we have a specific transparent color.
-    $transparency_index = imagecolortransparent($im);
-    if ($transparency_index >= 0) {
-      // Get the original image's transparent color's RGB values.
-      $transparent_color = imagecolorsforindex($im, $transparency_index);
-      // Allocate the same color in the new image resource.
-      $transparency_index = imagecolorallocate($res, $transparent_color['red'], $transparent_color['green'], $transparent_color['blue']);
-      // Completely fill the background of the new image with allocated color.
-      imagefill($res, 0, 0, $transparency_index);
-      // Set the background color for new image to transparent.
-      imagecolortransparent($res, $transparency_index);
-      // Find number of colors in the images palette.
-      $number_colors = imagecolorstotal($im);
-      // Convert from true color to palette to fix transparency issues.
-      imagetruecolortopalette($res, TRUE, $number_colors);
-    }
-  }
-  imagecopyresampled($res, $im, 0, 0, 0, 0, $width, $height, $info['width'], $info['height']);
-  $result = image_gd_close($res, $destination, $info['extension']);
-
-  imagedestroy($res);
-  imagedestroy($im);
-
-  return $result;
-}
-
-/**
- * Rotate an image the given number of degrees.
- */
-function image_gd_rotate($source, $destination, $degrees, $background = 0x000000) {
-  if (!function_exists('imageRotate')) {
-    return FALSE;
-  }
-
-  $info = image_get_info($source);
-  if (!$info) {
-    return FALSE;
-  }
-
-  $im = image_gd_open($source, $info['extension']);
-  if (!$im) {
-    return FALSE;
-  }
-
-  $res = imageRotate($im, $degrees, $background);
-  $result = image_gd_close($res, $destination, $info['extension']);
-
-  return $result;
-}
-
-/**
- * Crop an image using the GD toolkit.
- */
-function image_gd_crop($source, $destination, $x, $y, $width, $height) {
-  $info = image_get_info($source);
-  if (!$info) {
-    return FALSE;
-  }
-
-  $im = image_gd_open($source, $info['extension']);
-  $res = imageCreateTrueColor($width, $height);
-  imageCopy($res, $im, 0, 0, $x, $y, $width, $height);
-  $result = image_gd_close($res, $destination, $info['extension']);
-
-  imageDestroy($res);
-  imageDestroy($im);
-
-  return $result;
-}
-
-/**
- * GD helper function to create an image resource from a file.
- *
- * @param $file
- *   A string file path where the iamge should be saved.
- * @param $extension
- *   A string containing one of the following extensions: gif, jpg, jpeg, png.
- * @return
- *   An image resource, or FALSE on error.
- */
-function image_gd_open($file, $extension) {
-  $extension = str_replace('jpg', 'jpeg', $extension);
-  $open_func = 'imageCreateFrom' . $extension;
-  if (!function_exists($open_func)) {
-    return FALSE;
-  }
-  return $open_func($file);
-}
-
-/**
- * GD helper to write an image resource to a destination file.
- *
- * @param $res
- *   An image resource created with image_gd_open().
- * @param $destination
- *   A string file path where the iamge should be saved.
- * @param $extension
- *   A string containing one of the following extensions: gif, jpg, jpeg, png.
- * @return
- *   Boolean indicating success.
- */
-function image_gd_close($res, $destination, $extension) {
-  $extension = str_replace('jpg', 'jpeg', $extension);
-  $close_func = 'image' . $extension;
-  if (!function_exists($close_func)) {
-    return FALSE;
-  }
-  if ($extension == 'jpeg') {
-    return $close_func($res, $destination, variable_get('image_jpeg_quality', 75));
-  }
-  else {
-    return $close_func($res, $destination);
-  }
-}
-
-/**
- * @} End of "ingroup image".
- */
Index: includes/image.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/image.inc,v
retrieving revision 1.25
diff -u -p -r1.25 image.inc
--- includes/image.inc	14 Apr 2008 17:48:33 -0000	1.25
+++ includes/image.inc	6 Jul 2008 21:38:05 -0000
@@ -21,11 +21,13 @@
  * from this problem, but it requires the ISP to have installed additional
  * software.
  *
- * Image toolkits are installed by copying the image.ToolkitName.inc file into
- * Drupal's includes directory. The toolkit must then be enabled using the
- * admin/settings/image-toolkit form.
+ * Image toolkits are discovered based on the associated module's
+ * hook_image_toolkits. Additionally the image toolkit include file
+ * must be identified in the files array in the module.info file.  The
+ * toolkit must then be enabled using the admin/settings/image-toolkit
+ * form.
  *
- * Only one toolkit maybe selected at a time. If a module author wishes to call
+ * Only one toolkit may be selected at a time. If a module author wishes to call
  * a specific toolkit they can check that it is installed by calling
  * image_get_available_toolkits(), and then calling its functions directly.
  */
@@ -37,18 +39,17 @@
  *   An array of toolkit name => descriptive title.
  */
 function image_get_available_toolkits() {
-  $toolkits = file_scan_directory('includes', 'image\..*\.inc$');
+  // hook_image_toolkits returns an array of toolkit names.
+  $toolkits = module_invoke_all('image_toolkits');
 
   $output = array();
-  foreach ($toolkits as $file => $toolkit) {
-    include_once "./$file";
-    $function = str_replace('.', '_', $toolkit->name) . '_info';
-    if (function_exists($function)) {
+  foreach ($toolkits as $name) {
+    $function = 'image_' . $name . '_info';
+    if (drupal_function_exists($function)) {
       $info = $function();
       $output[$info['name']] = $info['title'];
     }
   }
-
   return $output;
 }
 
@@ -63,11 +64,11 @@ function image_get_toolkit() {
 
   if (!$toolkit) {
     $toolkit = variable_get('image_toolkit', 'gd');
-    $toolkit_file = './includes/image.' . $toolkit . '.inc';
-    if (isset($toolkit) && file_exists($toolkit_file)) {
-      include_once $toolkit_file;
+    if (isset($toolkit) &&
+      drupal_function_exists("image_" . $toolkit . "_resize")) {
     }
-    elseif (!image_gd_check_settings()) {
+    elseif (!drupal_function_exists("image_gd_check_settings") ||
+      !image_gd_check_settings()) {
       $toolkit = FALSE;
     }
   }
@@ -88,7 +89,7 @@ function image_get_toolkit() {
 function image_toolkit_invoke($method, $params = array()) {
   if ($toolkit = image_get_toolkit()) {
     $function = 'image_' . $toolkit . '_' . $method;
-    if (function_exists($function)) {
+    if (drupal_function_exists($function)) {
       return call_user_func_array($function, $params);
     }
     else {
Index: modules/system/image.gd.inc
===================================================================
RCS file: modules/system/image.gd.inc
diff -N modules/system/image.gd.inc
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ modules/system/image.gd.inc	6 Jul 2008 21:38:05 -0000
@@ -0,0 +1,221 @@
+<?php
+// $Id: image.gd.inc,v 1.6 2008/04/14 17:48:33 dries Exp $
+
+/**
+ * @file
+ * GD2 toolkit for image manipulation within Drupal.
+ */
+
+/**
+ * @ingroup image
+ * @{
+ */
+
+/**
+ * Retrieve information about the toolkit.
+ */
+function image_gd_info() {
+  return array('name' => 'gd', 'title' => t('GD2 image manipulation toolkit'));
+}
+
+/**
+ * Retrieve settings for the GD2 toolkit.
+ */
+function image_gd_settings() {
+  if (image_gd_check_settings()) {
+    $form = array();
+    $form['status'] = array(
+      '#value' => t('The GD toolkit is installed and working properly.')
+    );
+
+    $form['image_jpeg_quality'] = array(
+      '#type' => 'textfield',
+      '#title' => t('JPEG quality'),
+      '#description' => t('Define the image quality for JPEG manipulations. Ranges from 0 to 100. Higher values mean better image quality but bigger files.'),
+      '#size' => 10,
+      '#maxlength' => 3,
+      '#default_value' => variable_get('image_jpeg_quality', 75),
+      '#field_suffix' => t('%'),
+    );
+    $form['#element_validate'] = array('image_gd_settings_validate');
+
+    return $form;
+  }
+  else {
+    form_set_error('image_toolkit', t('The GD image toolkit requires that the GD module for PHP be installed and configured properly. For more information see <a href="@url">PHP\'s image documentation</a>.', array('@url' => 'http://php.net/image')));
+    return FALSE;
+  }
+}
+
+/**
+ * Validate the submitted GD settings.
+ */
+function image_gd_settings_validate($form, &$form_state) {
+  // Validate image quality range.
+  $value = $form_state['values']['image_jpeg_quality'];
+  if (!is_numeric($value) || $value < 0 || $value > 100) {
+    form_set_error('image_jpeg_quality', t('JPEG quality must be a number between 0 and 100.'));
+  }
+}
+
+/**
+ * Verify GD2 settings (that the right version is actually installed).
+ *
+ * @return
+ *   A boolean indicating if the GD toolkit is avaiable on this machine.
+ */
+function image_gd_check_settings() {
+  if ($check = get_extension_funcs('gd')) {
+    if (in_array('imagegd2', $check)) {
+      // GD2 support is available.
+      return TRUE;
+    }
+  }
+  return FALSE;
+}
+
+/**
+ * Scale an image to the specified size using GD.
+ */
+function image_gd_resize($source, $destination, $width, $height) {
+  if (!file_exists($source)) {
+    return FALSE;
+  }
+
+  $info = image_get_info($source);
+  if (!$info) {
+    return FALSE;
+  }
+
+  $im = image_gd_open($source, $info['extension']);
+  if (!$im) {
+    return FALSE;
+  }
+
+  $res = imagecreatetruecolor($width, $height);
+  if ($info['extension'] == 'png') {
+    $transparency = imagecolorallocatealpha($res, 0, 0, 0, 127);
+    imagealphablending($res, FALSE);
+    imagefilledrectangle($res, 0, 0, $width, $height, $transparency);
+    imagealphablending($res, TRUE);
+    imagesavealpha($res, TRUE);
+  }
+  elseif ($info['extension'] == 'gif') {
+    // If we have a specific transparent color.
+    $transparency_index = imagecolortransparent($im);
+    if ($transparency_index >= 0) {
+      // Get the original image's transparent color's RGB values.
+      $transparent_color = imagecolorsforindex($im, $transparency_index);
+      // Allocate the same color in the new image resource.
+      $transparency_index = imagecolorallocate($res, $transparent_color['red'], $transparent_color['green'], $transparent_color['blue']);
+      // Completely fill the background of the new image with allocated color.
+      imagefill($res, 0, 0, $transparency_index);
+      // Set the background color for new image to transparent.
+      imagecolortransparent($res, $transparency_index);
+      // Find number of colors in the images palette.
+      $number_colors = imagecolorstotal($im);
+      // Convert from true color to palette to fix transparency issues.
+      imagetruecolortopalette($res, TRUE, $number_colors);
+    }
+  }
+  imagecopyresampled($res, $im, 0, 0, 0, 0, $width, $height, $info['width'], $info['height']);
+  $result = image_gd_close($res, $destination, $info['extension']);
+
+  imagedestroy($res);
+  imagedestroy($im);
+
+  return $result;
+}
+
+/**
+ * Rotate an image the given number of degrees.
+ */
+function image_gd_rotate($source, $destination, $degrees, $background = 0x000000) {
+  if (!function_exists('imageRotate')) {
+    return FALSE;
+  }
+
+  $info = image_get_info($source);
+  if (!$info) {
+    return FALSE;
+  }
+
+  $im = image_gd_open($source, $info['extension']);
+  if (!$im) {
+    return FALSE;
+  }
+
+  $res = imageRotate($im, $degrees, $background);
+  $result = image_gd_close($res, $destination, $info['extension']);
+
+  return $result;
+}
+
+/**
+ * Crop an image using the GD toolkit.
+ */
+function image_gd_crop($source, $destination, $x, $y, $width, $height) {
+  $info = image_get_info($source);
+  if (!$info) {
+    return FALSE;
+  }
+
+  $im = image_gd_open($source, $info['extension']);
+  $res = imageCreateTrueColor($width, $height);
+  imageCopy($res, $im, 0, 0, $x, $y, $width, $height);
+  $result = image_gd_close($res, $destination, $info['extension']);
+
+  imageDestroy($res);
+  imageDestroy($im);
+
+  return $result;
+}
+
+/**
+ * GD helper function to create an image resource from a file.
+ *
+ * @param $file
+ *   A string file path where the iamge should be saved.
+ * @param $extension
+ *   A string containing one of the following extensions: gif, jpg, jpeg, png.
+ * @return
+ *   An image resource, or FALSE on error.
+ */
+function image_gd_open($file, $extension) {
+  $extension = str_replace('jpg', 'jpeg', $extension);
+  $open_func = 'imageCreateFrom' . $extension;
+  if (!function_exists($open_func)) {
+    return FALSE;
+  }
+  return $open_func($file);
+}
+
+/**
+ * GD helper to write an image resource to a destination file.
+ *
+ * @param $res
+ *   An image resource created with image_gd_open().
+ * @param $destination
+ *   A string file path where the iamge should be saved.
+ * @param $extension
+ *   A string containing one of the following extensions: gif, jpg, jpeg, png.
+ * @return
+ *   Boolean indicating success.
+ */
+function image_gd_close($res, $destination, $extension) {
+  $extension = str_replace('jpg', 'jpeg', $extension);
+  $close_func = 'image' . $extension;
+  if (!function_exists($close_func)) {
+    return FALSE;
+  }
+  if ($extension == 'jpeg') {
+    return $close_func($res, $destination, variable_get('image_jpeg_quality', 75));
+  }
+  else {
+    return $close_func($res, $destination);
+  }
+}
+
+/**
+ * @} End of "ingroup image".
+ */
Index: modules/system/system.info
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.info,v
retrieving revision 1.6
diff -u -p -r1.6 system.info
--- modules/system/system.info	6 May 2008 12:18:50 -0000	1.6
+++ modules/system/system.info	6 Jul 2008 21:38:05 -0000
@@ -6,3 +6,4 @@ version = VERSION
 core = 7.x
 files[] = system.module
 files[] = system.admin.inc
+files[] = image.gd.inc
Index: modules/system/system.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.module,v
retrieving revision 1.605
diff -u -p -r1.605 system.module
--- modules/system/system.module	1 Jul 2008 20:36:40 -0000	1.605
+++ modules/system/system.module	6 Jul 2008 21:38:05 -0000
@@ -2105,3 +2105,10 @@ function theme_meta_generator_html($vers
 function theme_meta_generator_header($version = VERSION) {
   drupal_set_header('X-Generator: Drupal ' . $version . ' (http://drupal.org)');
 }
+
+/**
+ * Implementation of hook_image_toolkits().
+ */
+function system_image_toolkits() {
+  return array('gd');
+}
