/[drupal]/contributions/modules/transformer/transforms/crop.transform
ViewVC logotype

Contents of /contributions/modules/transformer/transforms/crop.transform

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.3 - (show annotations) (download)
Sat Mar 10 04:59:19 2007 UTC (2 years, 8 months ago) by dopry
Branch: MAIN
CVS Tags: HEAD
Changes since 1.2: +1 -1 lines
a bit of drupal 5 lovin. I forgot I originally wrote this thing during 4.7.
1 <?php
2 /**
3 * Crop Transform Plugin.
4 */
5
6 function transformer_transform_crop_info() {
7 return array(
8 'title' => t('Crop'),
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_crop_form($data) {
16 //debug_msg($transform);
17 $form = array();
18 $form['width'] = array(
19 '#type' => 'textfield',
20 '#size' => 15,'#maxlength' => 30,
21 '#title' => t('Width'),
22 '#default_value' => $data['width'],
23 );
24 $form['height'] = array(
25 '#type' => 'textfield',
26 '#title' => t('Height'),
27 '#size' => 15,'#maxlength' => 30,
28 '#default_value' => $data['height'],
29 );
30 $form['xoffset'] = array(
31 '#type' => 'textfield',
32 '#title' => t('X Offset'),
33 '#size' => 15,'#maxlength' => 30,
34 '#default_value' => $data['xoffset'],
35 );
36 $form['yoffset'] = array(
37 '#type' => 'textfield',
38 '#title' => t('Y Offset'),
39 '#size' => 15,'#maxlength' => 30,
40 '#default_value' => $data['yoffset'],
41 );
42 $form['#validate'] = array('transformer_crop_form_validate' => array());
43 return $form;
44 }
45
46 function transformer_transform_crop_form_validate() {
47 }
48
49 function transformer_transform_crop_perform($source, $destination, $data) {
50 return image_crop($source, $destination, $data['xoffset'] , $data['yoffset'], $data['width'], $data['height']);
51 }

  ViewVC Help
Powered by ViewVC 1.1.2