| 1 |
<?php |
<?php |
| 2 |
// $Id: imagecache.module,v 1.68.2.17 2009/08/19 18:35:35 drewish Exp $ |
// $Id: imagecache.module,v 1.68.2.18 2009/08/19 20:59:15 drewish Exp $ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* @file |
* @file |
| 716 |
} |
} |
| 717 |
|
|
| 718 |
|
|
|
|
|
|
/************************************************************************************ |
|
|
* ImageCache action implementation example in module. |
|
|
*/ |
|
|
function imagecache_resize_image(&$image, $data) { |
|
|
if (!imageapi_image_resize($image, $data['width'], $data['height'])) { |
|
|
watchdog('imagecache', t('imagecache_resize_image failed. image: %image, data: %data.', array('%path' => $image, '%data' => print_r($data, true))), WATCHDOG_ERROR); |
|
|
return false; |
|
|
} |
|
|
return true; |
|
|
} |
|
|
|
|
|
function imagecache_resize_form($action) { |
|
|
$form['width'] = array( |
|
|
'#type' => 'textfield', |
|
|
'#title' => t('Width'), |
|
|
'#default_value' => $action['width'], |
|
|
'#description' => t('Enter a width in pixels or as a percentage. i.e. 500 or 80%.'), |
|
|
); |
|
|
$form['height'] = array( |
|
|
'#type' => 'textfield', |
|
|
'#title' => t('Height'), |
|
|
'#default_value' => $action['height'], |
|
|
'#description' => t('Enter a height in pixels or as a percentage. i.e. 500 or 80%.'), |
|
|
); |
|
|
return $form; |
|
|
} |
|
|
|
|
|
function theme_imagecache_resize($element) { |
|
|
$data = $element['#value']; |
|
|
return 'width: '. $data['width'] .', height: '. $data['height']; |
|
|
} |
|
|
|
|
|
|
|
|
|
|
| 719 |
/** |
/** |
| 720 |
* ImageCache 2.x API |
* ImageCache 2.x API |
| 721 |
* |
* |