diff options
author | kondou <kondou@ts.unde.re> | 2014-02-12 22:35:49 +0100 |
---|---|---|
committer | kondou <kondou@ts.unde.re> | 2014-02-12 22:35:49 +0100 |
commit | fc01a13811f5da395f1a9ed1171f15f5fffcb71e (patch) | |
tree | 65169d0ecc014c3669082a4cbfc7698b9698feea /lib/private/image.php | |
parent | 7af456730eef4a1c947188c12d69a0caf0a5bd2b (diff) | |
download | nextcloud-server-fc01a13811f5da395f1a9ed1171f15f5fffcb71e.tar.gz nextcloud-server-fc01a13811f5da395f1a9ed1171f15f5fffcb71e.zip |
Fix imagerotate and move loadFromBase64() one up.
imagerotate() with third parameter being -1 does not seem to work in PHP 5.5
loadFromBase64() one up, so debug-logs aren't spammed (as much) with urlencoded
base64-data from loadFromFile() debug output.
Diffstat (limited to 'lib/private/image.php')
-rw-r--r-- | lib/private/image.php | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/private/image.php b/lib/private/image.php index 91a9f91e1d6..0b99bf23f6e 100644 --- a/lib/private/image.php +++ b/lib/private/image.php @@ -346,7 +346,7 @@ class OC_Image { break; } if($rotate) { - $res = imagerotate($this->resource, $rotate, -1); + $res = imagerotate($this->resource, $rotate, 0); if($res) { if(imagealphablending($res, true)) { if(imagesavealpha($res, true)) { @@ -381,10 +381,10 @@ class OC_Image { } elseif(in_array(get_resource_type($imageRef), array('file', 'stream'))) { return $this->loadFromFileHandle($imageRef); } - } elseif($this->loadFromFile($imageRef) !== false) { - return $this->resource; } elseif($this->loadFromBase64($imageRef) !== false) { return $this->resource; + } elseif($this->loadFromFile($imageRef) !== false) { + return $this->resource; } elseif($this->loadFromData($imageRef) !== false) { return $this->resource; } else { @@ -415,7 +415,6 @@ class OC_Image { public function loadFromFile($imagePath=false) { // exif_imagetype throws "read error!" if file is less than 12 byte if(!@is_file($imagePath) || !file_exists($imagePath) || filesize($imagePath) < 12 || !is_readable($imagePath)) { - // Debug output disabled because this method is tried before loadFromBase64? OC_Log::write('core', 'OC_Image->loadFromFile, couldn\'t load: ' . (string) urlencode($imagePath), OC_Log::DEBUG); return false; } |