You are here

function imagemagick_element_validate_quality in ImageMagick 7

Form element validation handler for image quality settings field.

1 string reference to 'imagemagick_element_validate_quality'
image_imagemagick_settings in ./imagemagick.module
Retrieve settings for the ImageMagick toolkit.

File

./imagemagick.module, line 82
Provides ImageMagick integration.

Code

function imagemagick_element_validate_quality($element, &$form_state) {
  if (!is_numeric($element['#value']) || $element['#value'] < 0 || $element['#value'] > 100) {
    form_error($element, t('!name must be a value between 0 and 100.', array(
      '!name' => $element['#title'],
    )));
  }
}