summaryrefslogtreecommitdiffstats
path: root/lib/private
diff options
context:
space:
mode:
authorOlivier Paroz <oparoz@users.noreply.github.com>2014-11-24 17:32:53 +0100
committerOlivier Paroz <oparoz@users.noreply.github.com>2014-11-24 17:32:53 +0100
commite2a9bd78385aa4f30c99f622d4a53aa7accfe04c (patch)
treeb5886bfe19d2f8366dc0d9db464ca5e7d36d16b0 /lib/private
parent949d7b3312e51cb7076c6f51852cc7f04ea5ca58 (diff)
downloadnextcloud-server-e2a9bd78385aa4f30c99f622d4a53aa7accfe04c.tar.gz
nextcloud-server-e2a9bd78385aa4f30c99f622d4a53aa7accfe04c.zip
You can only change the oritentation of a JPEG
TIFFs also have EXIF headers, but they're not supported by the Image class PHP doc http://php.net/manual/en/function.exif-read-data.php
Diffstat (limited to 'lib/private')
-rw-r--r--lib/private/image.php4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/private/image.php b/lib/private/image.php
index bab91745c05..ecdad084c02 100644
--- a/lib/private/image.php
+++ b/lib/private/image.php
@@ -311,6 +311,10 @@ class OC_Image {
* @return int The orientation or -1 if no EXIF data is available.
*/
public function getOrientation() {
+ if ($this->imageType !== IMAGETYPE_JPEG) {
+ OC_Log::write('core', 'OC_Image->fixOrientation() Image is not a JPEG.', OC_Log::DEBUG);
+ return -1;
+ }
if(!is_callable('exif_read_data')) {
OC_Log::write('core', 'OC_Image->fixOrientation() Exif module not enabled.', OC_Log::DEBUG);
return -1;