From 2ec7183adb37f910f96b29ed148ca6ae2bc385b9 Mon Sep 17 00:00:00 2001 From: plegall Date: Sun, 1 Apr 2012 00:02:36 +0000 Subject: feature 2604: support rotation on derivatives git-svn-id: http://piwigo.org/svn/trunk@13843 68402e56-0260-453c-a942-63ccdbb3a9ee --- include/dblayer/functions_mysql.inc.php | 2 +- include/derivative.inc.php | 13 ++++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) (limited to 'include') 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); } } -- cgit v1.2.3