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

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

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


Revision 1.2 - (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.1: +1 -1 lines
a bit of drupal 5 lovin. I forgot I originally wrote this thing during 4.7.
1 <?php
2 /**
3 * Resize Transform
4 */
5
6
7
8 function transformer_transform_resize_info() {
9 return array(
10 'title' => t('Resize'),
11 'mimes' => array('image/jpeg','image/gif','image/png'),
12 'extensions' => array('gif','jpg','jpeg','png'),
13 );
14 }
15
16 function transformer_transform_resize_form($data) {
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 '#size' => 15,'#maxlength' => 30,
27 '#title' => t('Height'),
28 '#default_value' => $data['height'],
29 );
30 $form['#validate'] = array('transformer_transform_resize_form_validate' => array());
31 return $form;
32 }
33
34 function transformer_transform_resize_form_validate() {
35 }
36
37 function transformer_transform_resize_perform($source, $destination, $data) {
38 return image_resize($source, $destination, $data['width'], $data['height']);
39 }

  ViewVC Help
Powered by ViewVC 1.1.2