You are here

function canvasactions_roundedcorners_image in ImageCache Actions 6

Same name and namespace in other branches
  1. 5.3 canvasactions.inc \canvasactions_roundedcorners_image()
  2. 5.2 canvasactions.inc \canvasactions_roundedcorners_image()
  3. 6.2 canvasactions/rounded_corners.inc \canvasactions_roundedcorners_image()

File

./canvasactions.inc, line 696
Helper functions for the text2canvas action for imagecache

Code

function canvasactions_roundedcorners_image(&$image, $action = array()) {
  $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 imageapi_toolkit_invoke('roundedcorners', $image, array(
    $action,
  ));
}