diff --git a/imagefield_crop.module b/imagefield_crop.module index bc574af..79d48ba 100644 --- a/imagefield_crop.module +++ b/imagefield_crop.module @@ -129,15 +129,14 @@ function _imagefield_crop_widget_resolution_validate($element, &$form_state) { function _imagefield_crop_widget_enforce_ratio_validate($element, &$form_state) { $settings = $form_state['values']['instance']['widget']['settings']; - if ($settings['resolution']['x'] && !$element['#value']) { + if ($settings['resolution'] && !$element['#value']) { drupal_set_message(t('Output resolution is defined, but not enforced. Final images might be distroted')); } } function _imagefield_crop_widget_enforce_minimum_validate($element, &$form_state) { $settings = $form_state['values']['instance']['widget']['settings']; - $rw = ($settings['resolution']['x']) ? $settings['resolution']['x'] : 0; - $rh = ($settings['resolution']['y']) ? $settings['resolution']['y'] : 0; + list($rw, $rh) = !empty($settings['resolution']) ? explode('x', $settings['resolution']): array(0, 0); if ($settings['enforce_minimum'] && (!is_numeric($rw) || intval($rw) != $rw || $rw <= 0 ||