Changeset 12417 for extensions/rotateImage/ws_functions.inc.php
- Timestamp:
- Oct 12, 2011, 8:40:15 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/rotateImage/ws_functions.inc.php
r12409 r12417 9 9 'image_id'=>array(), 10 10 'angle'=>array('default'=>"90"), 11 'pwg_token' => array(), 12 'rotate_hd' => array('default'=>0) 11 13 ), 12 14 'Rotates a given image' … … 25 27 } 26 28 29 if (empty($params['pwg_token']) or get_pwg_token() != $params['pwg_token']) 30 { 31 return new PwgError(403, 'Invalid security token'); 32 } 33 27 34 include_once(PHPWG_ROOT_PATH.'admin/include/functions_upload.inc.php'); 28 35 include_once(PHPWG_ROOT_PATH.'admin/include/image.class.php'); 29 36 $image_id=(int)$params['image_id']; 30 37 $angle=(int)$params['angle']; 38 $rotate_hd = (int) $params['rotate_hd']; 31 39 $query=' 32 40 SELECT id, path, tn_ext, has_high … … 49 57 $img->write($image_path); 50 58 update_metadata(array($image_id=>$image_path)); 59 if ($rotate_hd) { 60 $sizes = array('thumb','high'); 61 } else { 62 $sizes = array('thumb'); 63 } 51 64 52 foreach ( array('thumb','high')as $size) {65 foreach ($sizes as $size) { 53 66 $resized_path = file_path_for_type($image_path,$size); 54 67 if (file_exists($resized_path)) { … … 59 72 } 60 73 return true; 61 62 74 } 63 75
Note: See TracChangeset
for help on using the changeset viewer.