Пример кода, который позволяет создать image style программно:
/**
* Implements hook_image_default_styles().
*/
function example_image_default_styles() {
$styles = array();
$styles['example_style_one'] = array(
'label' => 'Style one (610x300)',
'effects' => array(
array(
'name' => 'image_scale',
'data' => array('width' => 610, 'height' => 300, 'upscale' => TRUE),
'weight' => 0,
),
),
);
$styles['example_style_two'] = array(
'label' => 'Style two (460x290)',
'effects' => array(
array(
'name' => 'image_scale',
'data' => array('width' => 460, 'height' => 290, 'upscale' => FALSE),
'weight' => 1,
),
),
);
return $styles;
}