1 image.install | image_update_1000() |
Provide default image styles for the Image module.
Related topics
File
- core/
modules/ image/ image.install, line 130 - Install, update and uninstall functions for the image module.
Code
function image_update_1000() {
$data = array(
'overridden' => FALSE,
'module' => 'image',
'label' => 'Thumbnail (100x100)',
'name' => 'thumbnail',
'effects' => array(
array(
'name' => 'image_scale',
'data' => array(
'width' => 100,
'height' => 100,
'upscale' => 1,
),
'weight' => 1,
),
),
);
$config = config('image.style.thumbnail');
$config->setData($data);
$config->save();
$data = array(
'overridden' => FALSE,
'module' => 'image',
'label' => 'Medium (220x220)',
'name' => 'medium',
'effects' => array(
array(
'name' => 'image_scale',
'data' => array(
'width' => 220,
'height' => 220,
'upscale' => 1,
),
'weight' => 1,
),
),
);
$config = config('image.style.medium');
$config->setData($data);
$config->save();
$data = array(
'overridden' => FALSE,
'module' => 'image',
'label' => 'Large (480x480)',
'name' => 'large',
'effects' => array(
array(
'name' => 'image_scale',
'data' => array(
'width' => 480,
'height' => 480,
'upscale' => 1,
),
'weight' => 1,
),
),
);
$config = config('image.style.large');
$config->setData($data);
$config->save();
}