function image_update_2 in Image 5
Same name and namespace in other branches
- 5.2 image.install \image_update_2()
- 6 image.install \image_update_2()
- 7 image.install \image_update_2()
Upgrade to the new image_sizes variable format.
File
- ./
image.install, line 49
Code
function image_update_2() {
$sizes = variable_get('image_sizes', FALSE);
if ($sizes) {
$new_sizes = array(
IMAGE_ORIGINAL => array(
'width' => '',
'height' => '',
'label' => t('Original'),
),
);
foreach ($sizes as $size) {
$key = drupal_strtolower($size['label']);
$size['label'] = drupal_ucfirst($size['label']);
$new_sizes[$key] = $size;
}
variable_set('image_sizes', $new_sizes);
}
return array();
}