#89103 by quicksketch, allow scaling on one dimension.
authorDarrel O\'Pry
Wed, 29 Nov 2006 07:56:33 +0000 (07:56 +0000)
committerDarrel O\'Pry
Wed, 29 Nov 2006 07:56:33 +0000 (07:56 +0000)
imagecache.module

index 59f6ea1..0c4f8b9 100644 (file)
@@ -103,6 +103,10 @@ function imagecache_cache() {
           break;
       
         case 'scale':
+          // set width and height to impossibly large values if unset. allows scaling by only 
+          // specifying a single dimension.
+          $action['data']['width'] = $action['data']['width'] ? $action['data']['width'] : 9999999;
+          $action['data']['height'] = $action['data']['height'] ? $action['data']['height'] : 9999999;
           if (!image_scale($tmpdestination, $tmpdestination, $action['data']['width'], $action['data']['height'])) {
             watchdog('imagecache', t('Imagecache scale action ID %id failed.', array('%id' => $action['actionid'])), WATCHDOG_ERROR);
           }