function imagefield_crop_entity_presave in Imagefield Crop 7
Implements hook_entity_presave().
File
- ./
imagefield_crop.module, line 449 - Provide a widget to crop uploaded image.
Code
function imagefield_crop_entity_presave($entity, $type) {
// HACK - until http://drupal.org/node/1448124 is addressed, the iamgesize
// is stored in the field instance and we have no way of cleanly altering
// it correctly, so do it here.
$fields = field_info_instances($type, isset($entity->type) ? $entity->type : NULL);
if (isset($entity->type)) {
_imagefield_crop_entity_presave($entity, $fields);
}
else {
foreach ($fields as $bundle) {
_imagefield_crop_entity_presave($entity, $bundle);
}
}
}