Index: includes/image.gd.inc =================================================================== --- includes/image.gd.inc (revision 1) +++ includes/image.gd.inc (working copy) @@ -23,7 +23,6 @@ */ function image_gd_settings() { if (image_gd_check_settings()) { - $form = array(); $form['status'] = array( '#value' => t('The GD toolkit is installed and working properly.') ); @@ -38,15 +37,23 @@ '#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 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; +} + /** * Validate the submitted GD settings. */