You are here

function image_crop_validate_size in Image javascript crop 7

Validate the entered height / width. (can be procent or numeric)

1 string reference to 'image_crop_validate_size'
imagecrop_effect_form in includes/imagecrop.effects.inc
Settings form for configuring a javascript imagecrop effect.

File

includes/imagecrop.effects.inc, line 172
Registry for the image style effects from imagecrop.

Code

function image_crop_validate_size($element, &$form_state) {
  $value = str_replace('%', '', $element['#value']);
  if ($value != '' && (!is_numeric($value) || intval($value) <= 0)) {
    form_error($element, t('!name must be a correct size.', array(
      '!name' => $element['#title'],
    )));
  }
}