You are here

function image_gd_settings_validate in Drupal 7

Same name and namespace in other branches
  1. 6 includes/image.gd.inc \image_gd_settings_validate()

Validate the submitted GD settings.

Related topics

1 string reference to 'image_gd_settings_validate'
image_gd_settings in modules/system/image.gd.inc
Retrieve settings for the GD2 toolkit.

File

modules/system/image.gd.inc, line 44
GD2 toolkit for image manipulation within Drupal.

Code

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.'));
  }
}