You are here

function image_update_2 in Image 5.2

Same name and namespace in other branches
  1. 5 image.install \image_update_2()
  2. 6 image.install \image_update_2()
  3. 7 image.install \image_update_2()

Upgrade to the new image_sizes variable format.

File

./image.install, line 85

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();
}