Ignore:
Timestamp:
Feb 23, 2012, 3:25:41 PM (9 years ago)
Author:
plg
Message:

new option to compute rotation angle from EXIF orientation tag

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/rotateImage/ws_functions.inc.php

    r13316 r13319  
    3737  include_once(PHPWG_ROOT_PATH.'admin/include/image.class.php');
    3838  $image_id=(int)$params['image_id'];
    39   $angle=(int)$params['angle'];
    40   $rotate_hd = get_boolean($params['rotate_hd']);
     39 
    4140  $query='
    4241SELECT id, path, tn_ext, has_high
     
    5049  }
    5150
    52   if ($rotate_hd and get_boolean($image['has_high'])) {
     51  // rotation angle
     52  if ('auto' == $params['angle']) {
     53    $angle = $params['angle'];
     54  }
     55  else {
     56    $angle = (int)$params['angle'];
     57  }
     58
     59  if (get_boolean($params['rotate_hd']) and get_boolean($image['has_high'])) {
    5360    $to_rotate_path = file_path_for_type($image['path'], 'high');
    5461    $quality = $conf['upload_form_hd_quality'];
    5562    $regenerate_websize = true;
     63
     64    if ('auto' == $angle) {
     65      $angle = pwg_image::get_rotation_angle($to_rotate_path);
     66    }
    5667  }
    5768  else {
Note: See TracChangeset for help on using the changeset viewer.