You are here

function canvasactions_resizepercent_dimensions in ImageCache Actions 8

Same name and namespace in other branches
  1. 7 canvasactions/canvasactions.inc \canvasactions_resizepercent_dimensions()

Image dimensions callback for the resize percent effect.

Parameters

array $dimensions: Dimensions to be modified - an associative array containing the items 'width' and 'height' (in pixels).

array $data: An associative array containing the effect data.

1 string reference to 'canvasactions_resizepercent_dimensions'
imagecache_canvasactions_image_effect_info in canvasactions/imagecache_canvasactions.module
Implements hook_image_effect_info().

File

canvasactions/canvasactions.inc, line 1090

Code

function canvasactions_resizepercent_dimensions(array &$dimensions, array $data) {
  $data = _canvasactions_resizepercent_calculate_percent($data);
  $dimensions['width'] = (int) round($dimensions['width'] * $data['width']);
  $dimensions['height'] = (int) round($dimensions['height'] * $data['height']);
}