]> source.dussan.org Git - nextcloud-server.git/commitdiff
You can only change the oritentation of a JPEG
authorOlivier Paroz <oparoz@users.noreply.github.com>
Mon, 24 Nov 2014 16:32:53 +0000 (17:32 +0100)
committerOlivier Paroz <oparoz@users.noreply.github.com>
Mon, 24 Nov 2014 16:32:53 +0000 (17:32 +0100)
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

lib/private/image.php

index bab91745c0505593cb8b2597bfbc680085a5f38c..ecdad084c02220a8a18c016f7aabb13d0fa7b3d1 100644 (file)
@@ -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;