You are here

function _imagefield_crop_widget_resolution_validate in Imagefield Crop 7

1 string reference to '_imagefield_crop_widget_resolution_validate'
imagefield_crop_field_widget_settings_form in ./imagefield_crop.module
Implements hook_field_widget_settings_form().

File

./imagefield_crop.module, line 160
Provide a widget to crop uploaded image.

Code

function _imagefield_crop_widget_resolution_validate($element, &$form_state) {
  $settings = $form_state['values']['instance']['widget']['settings'];

  // _image_field_resolution_validate() does most of the validation.
  if ($settings['enforce_ratio'] && empty($element['x']['#value'])) {
    form_error($element, t('Target resolution must be defined as WIDTHxHEIGHT if resolution is to be enforced'));
  }
}