? .cache ? .project ? .projectOptions ? files ? image.gd_102987.patch ? temp ? test.patch ? includes/.image.gd.inc.swp ? includes/image.imagemagick.inc ? misc/Thumbs.db ? misc/farbtastic/Thumbs.db ? sites/all/modules ? sites/default/settings.php Index: includes/image.gd.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/image.gd.inc,v retrieving revision 1.2 diff -u -p -u -p -r1.2 image.gd.inc --- includes/image.gd.inc 7 Aug 2007 08:39:35 -0000 1.2 +++ includes/image.gd.inc 10 Oct 2007 17:37:08 -0000 @@ -23,7 +23,6 @@ function image_gd_info() { */ function image_gd_settings() { if (image_gd_check_settings()) { - $form = array(); $form['status'] = array( '#value' => t('The GD toolkit is installed and working properly.') ); @@ -37,13 +36,19 @@ function image_gd_settings() { '#default_value' => variable_get('image_jpeg_quality', 75), '#field_suffix' => t('%'), ); - - 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 PHP\'s image documentation.', array('@url' => 'http://php.net/image'))); - return FALSE; + $form['#after_build'] = array('_image_gd_settings_missing'); + } + return $form; +} + +function _image_gd_settings_missing($form, $form_state) { + // Don't report errors if another toolkit is being selected. + if (!isset($form['#post']['image_toolkit']) || $form['#post']['image_toolkit'] == 'gd') { + form_set_error('image_toolkit', t('The built-in GD image toolkit requires that the GD module for PHP be installed and configured properly. For more information see PHP\'s image documentation.', array('@url' => 'http://php.net/image'))); } + return $form; } /**