| 1 |
<?php
|
| 2 |
/**
|
| 3 |
* Fill Transform
|
| 4 |
*/
|
| 5 |
|
| 6 |
function transformer_transform_fill_info() {
|
| 7 |
return array(
|
| 8 |
'title' => t('Fill'),
|
| 9 |
'mimes' => array('image/jpeg','image/gif','image/png'),
|
| 10 |
'extensions' => array('gif','jpg','jpeg','png'),
|
| 11 |
'priority' => 0,
|
| 12 |
);
|
| 13 |
}
|
| 14 |
|
| 15 |
function transformer_transform_fill_form($data) {
|
| 16 |
$form = array();
|
| 17 |
$form['fill_color'] = array(
|
| 18 |
'#type' => 'textfield',
|
| 19 |
'#title' => t('Fill color'),
|
| 20 |
'#size' => 15,'#maxlength' => 30,
|
| 21 |
'#default_value' => $data['fill_color'],
|
| 22 |
);
|
| 23 |
$form['#validate'] = array('transformer_transform_fill_form_validate' => array());
|
| 24 |
return $form;
|
| 25 |
}
|
| 26 |
|
| 27 |
function transformer_transform_fill_form_validate() {
|
| 28 |
}
|
| 29 |
|
| 30 |
function transformer_transform_fill_perform($source, $destination, $data) { //*
|
| 31 |
_transformer_transform_hex2rgb($data['fill_color'],$r,$g,$b);
|
| 32 |
return image_toolkit_invoke('fill', array($source, $destination, $r, $g, $b));
|
| 33 |
}
|
| 34 |
?>
|