You are here

function canvasactions_roundedcorners_effect in ImageCache Actions 8

Same name and namespace in other branches
  1. 7 canvasactions/rounded_corners.inc \canvasactions_roundedcorners_effect()
1 string reference to 'canvasactions_roundedcorners_effect'
imagecache_canvasactions_image_effect_info in canvasactions/imagecache_canvasactions.module
Implements hook_image_effect_info().

File

canvasactions/rounded_corners.inc, line 104
Routines for rounded corners

Code

function canvasactions_roundedcorners_effect($image, $action) {
  $independent_corners = !empty($action['independent_corners_set']['independent_corners']);
  if (!$independent_corners) {

    // set the independant corners to all be the same.
    $corners = array(
      'tl',
      'tr',
      'bl',
      'br',
    );
    foreach ($corners as $key) {

      // Use the all-the-same radius setting.
      $action['independent_corners_set']['radii'][$key] = $action['radius'];
    }
  }
  return image_toolkit_invoke('roundedcorners', $image, array(
    $action,
  ));
}