You are here

function canvasactions_resizepercent_effect in ImageCache Actions 8

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

Image effect callback for the resize percent effect.

Parameters

stdClass $image:

array $data:

Return value

boolean true on success, false otherwise.

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

File

canvasactions/canvasactions.inc, line 1072

Code

function canvasactions_resizepercent_effect(stdClass $image, array $data) {
  $data = _canvasactions_resizepercent_calculate_percent($data);
  $data['width'] = (int) round($image->info['width'] * $data['width']);
  $data['height'] = (int) round($image->info['height'] * $data['height']);
  return image_resize_effect($image, $data);
}