1 image.field.inc | _image_field_resolution_validate($element, &$form_state) |
Element validate function for resolution fields.
File
- core/
modules/ image/ image.field.inc, line 249 - Implement an image field, based on the file module's file field.
Code
function _image_field_resolution_validate($element, &$form_state) {
if (empty($element['x']['#value'])) {
$element['x']['#value'] = 0;
}
if (empty($element['y']['#value'])) {
$element['y']['#value'] = 0;
}
if (!empty($element['x']['#value']) || !empty($element['y']['#value'])) {
form_set_value($element, $element['x']['#value'] . 'x' . $element['y']['#value'], $form_state);
}
else {
form_set_value($element, '', $form_state);
}
}