aboutsummaryrefslogtreecommitdiffstats
path: root/include/derivative.inc.php
diff options
context:
space:
mode:
authorplegall <plg@piwigo.org>2012-04-01 00:02:36 +0000
committerplegall <plg@piwigo.org>2012-04-01 00:02:36 +0000
commit2ec7183adb37f910f96b29ed148ca6ae2bc385b9 (patch)
treec20d0873a06233f15f039848457265d1d96936ea /include/derivative.inc.php
parent3a76852f0ce5573585fd70623321d8cb7e736ab3 (diff)
feature 2604: support rotation on derivatives
git-svn-id: http://piwigo.org/svn/trunk@13843 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'include/derivative.inc.php')
-rw-r--r--include/derivative.inc.php13
1 files changed, 12 insertions, 1 deletions
diff --git a/include/derivative.inc.php b/include/derivative.inc.php
index 144e76a27..ca840a4d9 100644
--- a/include/derivative.inc.php
+++ b/include/derivative.inc.php
@@ -55,7 +55,18 @@ final class SrcImage
if (!$this->size && isset($infos['width']) && isset($infos['height']))
{
- $this->size = array($infos['width'], $infos['height']);
+ $width = $infos['width'];
+ $height = $infos['height'];
+
+ // 1 or 5 => 90 clockwise
+ // 3 or 7 => 270 clockwise
+ if ($infos['rotation'] % 2 != 0)
+ {
+ $width = $infos['height'];
+ $height = $infos['width'];
+ }
+
+ $this->size = array($width, $height);
}
}