You are here

function imagecache_actions_validate_alpha in ImageCache Actions 6.2

Same name and namespace in other branches
  1. 8 utility-form.inc \imagecache_actions_validate_alpha()
  2. 6 utility.inc \imagecache_actions_validate_alpha()
  3. 7 utility-form.inc \imagecache_actions_validate_alpha()

Check the alpha value is valid.

File

./utility-form.inc, line 54
Utility form, conversion and rendering functions for image processes

Code

function imagecache_actions_validate_alpha(&$element, &$form_status) {
  if (!is_numeric($element['#value']) || $element['#value'] < 1 || $element['#value'] > 100) {
    form_set_error(join('][', $element['#parents']), t('Opacity must be a number between 1 and 100.'));
  }
}