diff --git a/canvasactions/canvasactions.inc b/canvasactions/canvasactions.inc
index d5d9d80..1bbc87b 100755
--- a/canvasactions/canvasactions.inc
+++ b/canvasactions/canvasactions.inc
@@ -180,44 +180,43 @@ function theme_canvasactions_definecanvas_summary($variables) {
  *
  *   $image->resource handle on the image object
  */
-function canvasactions_definecanvas_image($image, $action = array()) {
-
+function canvasactions_definecanvas_effect(&$image, $data) {
   // May be given either exact or relative dimensions.
   // ED: check on width OR height
-  //if ($action['exact']['width'] || $action['exact']['width']) {
-  if ($action['exact']['width'] || $action['exact']['height']) {
+  //if ($data['exact']['width'] || $data['exact']['width']) {
+  if ($data['exact']['width'] || $data['exact']['height']) {
     // Allows only one dimension to be used if the other is unset.
-    if (! $action['exact']['width']) {
-      $ction['exact']['width'] = $image->info['width'];
+    if (! $data['exact']['width']) {
+      $data['exact']['width'] = $image->info['width'];
     }
-    if (! $action['exact']['height']) {
-      $action['exact']['height'] = $image->info['height'];
+    if (! $data['exact']['height']) {
+      $data['exact']['height'] = $image->info['height'];
     }
 
-    $targetsize['width'] = imagecache_actions_percent_filter($action['exact']['width'], $image->info['width']);
-    $targetsize['height'] = imagecache_actions_percent_filter($action['exact']['height'], $image->info['height']);
+    $targetsize['width'] = imagecache_actions_percent_filter($data['exact']['width'], $image->info['width']);
+    $targetsize['height'] = imagecache_actions_percent_filter($data['exact']['height'], $image->info['height']);
 
-    $targetsize['left'] = image_filter_keyword($action['exact']['xpos'], $targetsize['width'], $image->info['width']);
-    $targetsize['top'] = image_filter_keyword($action['exact']['ypos'], $targetsize['height'], $image->info['height']);
+    $targetsize['left'] = image_filter_keyword($data['exact']['xpos'], $targetsize['width'], $image->info['width']);
+    $targetsize['top'] = image_filter_keyword($data['exact']['ypos'], $targetsize['height'], $image->info['height']);
 
   }
   else {
     // calculate relative size
-    $targetsize['width'] = $image->info['width'] + $action['relative']['leftdiff'] +  $action['relative']['rightdiff'];
-    $targetsize['height'] = $image->info['height'] + $action['relative']['topdiff'] +  $action['relative']['bottomdiff'];
-    $targetsize['left'] = $action['relative']['leftdiff'];
-    $targetsize['top'] = $action['relative']['topdiff'];
+    $targetsize['width'] = $image->info['width'] + $data['relative']['leftdiff'] +  $data['relative']['rightdiff'];
+    $targetsize['height'] = $image->info['height'] + $data['relative']['topdiff'] +  $data['relative']['bottomdiff'];
+    $targetsize['left'] = $data['relative']['leftdiff'];
+    $targetsize['top'] = $data['relative']['topdiff'];
   }
 
   // convert from hex (as it is stored in the UI)
-  if ($action['RGB']['HEX'] && $deduced = imagecache_actions_hex2rgba($action['RGB']['HEX'])) {
-    $action['RGB'] = array_merge($action['RGB'], $deduced);
+  if ($data['RGB']['HEX'] && $deduced = imagecache_actions_hex2rgba($data['RGB']['HEX'])) {
+    $data['RGB'] = array_merge($data['RGB'], $deduced);
   }
 
   // All the maths is done, now defer to the api toolkits;
-  $action['targetsize'] = $targetsize;
+  $data['targetsize'] = $targetsize;
 
-  $success = image_toolkit_invoke('definecanvas', $image, array($action));
+  $success = image_toolkit_invoke('definecanvas', $image, array($data));
   if ($success) {
     $image->info['width'] = $targetsize['width'];
     $image->info['height'] = $targetsize['height'];
@@ -225,6 +224,31 @@ function canvasactions_definecanvas_image($image, $action = array()) {
   return $success;
 }
 
+function canvasactions_definecanvas_dimensions(array &$dimensions, array $data) {
+  // May be given either exact or relative dimensions.
+  // ED: check on width OR height
+  if ($data['exact']['width'] || $data['exact']['height']) {
+    // Allows only one dimension to be used if the other is unset.
+    if (! $data['exact']['width']) {
+      $data['exact']['width'] = $dimensions['width'];
+    }
+    if (! $data['exact']['height']) {
+      $data['exact']['height'] = $dimensions['height'];
+    }
+
+    $targetsize['width'] = imagecache_actions_percent_filter($data['exact']['width'], $dimensions['width']);
+    $targetsize['height'] = imagecache_actions_percent_filter($data['exact']['height'], $dimensions['height']);
+  }
+  else {
+    // calculate relative size
+    $targetsize['width'] = $dimensions['width'] + $data['relative']['leftdiff'] +  $data['relative']['rightdiff'];
+    $targetsize['height'] = $dimensions['height'] + $data['relative']['topdiff'] +  $data['relative']['bottomdiff'];
+  }
+  
+  $dimensions['width'] = $targetsize['width'];
+  $dimensions['height'] = $targetsize['height'];
+}
+
 /**
  * Draw a color (or transparency) behind an image
  *
diff --git a/canvasactions/imagecache_canvasactions.module b/canvasactions/imagecache_canvasactions.module
index 7b90e09..128feae 100755
--- a/canvasactions/imagecache_canvasactions.module
+++ b/canvasactions/imagecache_canvasactions.module
@@ -60,7 +60,8 @@ function imagecache_canvasactions_image_effect_info() {
   $effects['canvasactions_definecanvas'] = array(
     'label' => t('Define canvas'),
     'help' => t('Define the size of the working canvas and background color, this controls the dimensions of the output image.'),
-    'effect callback' => 'canvasactions_definecanvas_image',
+    'effect callback' => 'canvasactions_definecanvas_effect',
+    'dimensions callback' => 'canvasactions_definecanvas_dimensions',
     'form callback' => 'canvasactions_definecanvas_form',
     'summary theme' => 'canvasactions_definecanvas_summary',
   );
@@ -69,6 +70,7 @@ function imagecache_canvasactions_image_effect_info() {
     'label' => t('Overlay (watermark)'),
     'help' => t('Choose the file image you wish to use as an overlay, and position it in a layer on top of the canvas.'),
     'effect callback' => 'canvasactions_file2canvas_image',
+    'dimensions passthrough' => TRUE,
     'form callback' => 'canvasactions_file2canvas_form',
     'summary theme' => 'canvasactions_file2canvas_summary',
   );
@@ -77,6 +79,7 @@ function imagecache_canvasactions_image_effect_info() {
     'label' => t('Underlay (background)'),
     'help' => t('Choose the file image you wish to use as an background, and position the processed image on it.'),
     'effect callback' => 'canvasactions_canvas2file_image',
+    'dimensions passthrough' => TRUE,
     'form callback' => 'canvasactions_canvas2file_form',
     'summary theme' => 'canvasactions_canvas2file_summary',
   );
@@ -85,6 +88,7 @@ function imagecache_canvasactions_image_effect_info() {
     'label' => t('Overlay: source image to canvas'),
     'help' => t('Places the source image onto the canvas for compositing.'),
     'effect callback' => 'canvasactions_source2canvas_image',
+    'dimensions passthrough' => TRUE,
     'form callback' => 'canvasactions_source2canvas_form',
     'summary theme' => 'canvasactions_source2canvas_summary',
   );
@@ -93,6 +97,7 @@ function imagecache_canvasactions_image_effect_info() {
     'label' => t('Rounded Corners'),
     'help' => t('This is true cropping, not overlays, so the result <em>can</em> be transparent.'),
     'effect callback' => 'canvasactions_roundedcorners_image',
+    'dimensions passthrough' => TRUE,
     'form callback' => 'canvasactions_roundedcorners_form',
     'summary theme' => 'canvasactions_roundedcorners_summary',
   );
@@ -101,6 +106,7 @@ function imagecache_canvasactions_image_effect_info() {
     'label' => t('Aspect switcher'),
     'help' => t('Use different effects depending on whether the image is landscape of portrait shaped. This re-uses other preset definitions, and just chooses between them based on the rule.'),
     'effect callback' => 'canvasactions_aspect_image',
+    'dimensions passthrough' => TRUE,
     'form callback' => 'canvasactions_aspect_form',
     'summary theme' => 'canvasactions_aspect_summary',
   );
