function imagecache_colorshift_image in ImageCache Actions 6
Same name and namespace in other branches
- 5.3 imagecache_coloractions.module \imagecache_colorshift_image()
- 5.2 imagecache_coloractions.module \imagecache_colorshift_image()
- 6.2 coloractions/imagecache_coloractions.module \imagecache_colorshift_image()
Implementation of hook_image()
Process the imagecache action on the passed image
Just converts and passes the vals to the all-purpose 'filter' action
File
- ./
imagecache_coloractions.module, line 119 - Additional actions for imagecache processing.
Code
function imagecache_colorshift_image(&$image, $data = array()) {
// convert color from hex (as it is stored in the UI)
if ($data['RGB']['HEX'] && ($deduced = hex_to_rgb($data['RGB']['HEX']))) {
$data['RGB'] = array_merge($data['RGB'], $deduced);
}
$data['filter'] = 4;
$data['filter_arg1'] = $data['RGB']['red'];
$data['filter_arg2'] = $data['RGB']['green'];
$data['filter_arg3'] = $data['RGB']['blue'];
return imagecache_imagefilter($image, $data);
}