diff options
author | plegall <plg@piwigo.org> | 2012-04-01 00:02:36 +0000 |
---|---|---|
committer | plegall <plg@piwigo.org> | 2012-04-01 00:02:36 +0000 |
commit | 2ec7183adb37f910f96b29ed148ca6ae2bc385b9 (patch) | |
tree | c20d0873a06233f15f039848457265d1d96936ea /include | |
parent | 3a76852f0ce5573585fd70623321d8cb7e736ab3 (diff) |
feature 2604: support rotation on derivatives
git-svn-id: http://piwigo.org/svn/trunk@13843 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r-- | include/dblayer/functions_mysql.inc.php | 2 | ||||
-rw-r--r-- | include/derivative.inc.php | 13 |
2 files changed, 13 insertions, 2 deletions
diff --git a/include/dblayer/functions_mysql.inc.php b/include/dblayer/functions_mysql.inc.php index 65cb9fbd2..a7655e544 100644 --- a/include/dblayer/functions_mysql.inc.php +++ b/include/dblayer/functions_mysql.inc.php @@ -370,7 +370,7 @@ UPDATE '.$tablename.' { $separator = $is_first ? '' : ",\n "; - if (isset($value) and $value != '') + if (isset($value) and $value !== '') { $query.= $separator.$key.' = \''.$value.'\''; } 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); } } |