Se recomienda usar hook_node_insert () y hook_node_update () y verificar si no se generan los derivados de imagen necesarios, luego generarlos, de lo contrario, no haga nada.
/**
* Implements hook_node_insert to generate derivative images for the new inserted node in
* case they are not generated
* @param object $node
*/
function YOUR_MODULE_node_insert($node) {
//REPLACE field_YOUR_IMAGE_FIELD WITH YOUR FIELD IMAGE NAME
if(isset($node->field_YOUR_IMAGE_FIELD['und'][0]['uri'])) {
_generate_image_style($node->field_YOUR_IMAGE_FIELD['und'][0]['uri']);
}
}
/**
* Implements hook_node_update to generate derivative images for the new updated node in
* case they are not generated
* @param object $node
*/
function YOUR_MODULE_node_update($node) {
//REPLACE field_YOUR_IMAGE_FIELD WITH YOUR FIELD IMAGE NAME
if(isset($node->field_YOUR_IMAGE_FIELD['und'][0]['uri'])) {
_generate_image_style($node->field_YOUR_IMAGE_FIELD['und'][0]['uri']);
}
}
/**
* Generates the needed image styles by the image uri if they are not already generated
* @param string $image_uri
*/
function _generate_image_style($image_uri) {
//This should be changed to your image styles names.
$image_styles = array('image_style_name1', 'large_image', 'promo_image');
foreach ($image_styles as $style) {
$derivative_uri = image_style_path($style, $image_uri);
file_exists($derivative_uri) || image_style_create_derivative(image_style_load($style), $image_uri, $derivative_uri);
}
}
Nota: Si su campo de imagen toma varias imágenes, entonces debe recorrerlas de esa manera:
if(isset($node->field_main_image['und']) && is_array($node->field_main_image['und'])) {
foreach($node->field_main_image['und'] as $delta => $image_field) {
_generate_image_style($node->field_YOUR_IMAGE_FIELD['und'][$delta]['uri']);
}
}
La generación de estilos de imagen se toma desde aquí.