Skip to content
Snippets Groups Projects
Commit e2a9bd78 authored by Olivier Paroz's avatar Olivier Paroz
Browse files

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
parent 949d7b33
No related branches found
No related tags found
No related merge requests found
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment