Index: imagefield.css =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/imagefield/imagefield.css,v retrieving revision 1.2.4.2 diff -u -F^f -r1.2.4.2 imagefield.css --- imagefield.css 18 Apr 2008 10:31:40 -0000 1.2.4.2 +++ imagefield.css 27 May 2008 02:16:16 -0000 @@ -29,3 +29,7 @@ float: right; } +div.imagefield-edit-image-rotate div.form-radios div.form-item { + float: left; + padding-right: .5em; +} Index: imagefield.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/imagefield/imagefield.module,v retrieving revision 1.30.2.6.2.64 diff -u -F^f -r1.30.2.6.2.64 imagefield.module --- imagefield.module 13 May 2008 00:02:02 -0000 1.30.2.6.2.64 +++ imagefield.module 27 May 2008 02:16:16 -0000 @@ -286,6 +286,22 @@ function imagefield_file_update($node, & return array(); } } + + if ($file['rotate'] != 0) { + if (module_exists('imageapi')) { + $image = imageapi_image_open($file['filepath']); + imageapi_image_rotate($image, $file['rotate']); + imageapi_image_close($image); + } + else { + image_rotate($file['filepath'], $file['filepath'], $file['rotate']); + } + + if (module_exists('imagecache')) { + imagecache_image_flush($file['filepath']); + } + } + if ($file['fid'] == 'upload') { return imagefield_file_insert($node, $file, $field); } @@ -791,6 +807,18 @@ function _imagefield_widget_form($node, ); } + $form[$fieldname][$delta]['rotate'] = array( + '#type' => 'radios', + '#title' => t('Rotate clockwise'), + '#options' => array( + 0 => t('0°'), + 90 => t('90°'), + 180 => t('180°'), + 270 => t('270°'), + ), + '#default_value' => 0, + ); + // Special handling for single value fields if (!$field['multiple']) { $form[$fieldname][$delta]['replace'] = array( @@ -1015,6 +1043,7 @@ function theme_imagefield_edit_image_row $output .= ''; $output .= drupal_render($element['alt']); $output .= drupal_render($element['title']); + $output .= '
'. drupal_render($element['rotate']) .'
'; $output .= ''; $output = '
'. $output .'
'; if (isset($element['replace'])) {