From 5c21798ed3c68d6dded1c75166ee0e9bb4ac5d14 Mon Sep 17 00:00:00 2001 From: friendica Date: Thu, 7 Feb 2013 19:55:40 -0800 Subject: cleanup issues discovered in the logs --- include/Photo.php | 80 ++++++++++++++++++++++++++++--------------------------- 1 file changed, 41 insertions(+), 39 deletions(-) (limited to 'include/Photo.php') diff --git a/include/Photo.php b/include/Photo.php index a60cfc868..3eccbb5fb 100644 --- a/include/Photo.php +++ b/include/Photo.php @@ -325,45 +325,47 @@ class Photo { if( (! function_exists('exif_read_data')) || ($this->getType() !== 'image/jpeg') ) return; - $exif = exif_read_data($filename); - $ort = $exif['Orientation']; - - switch($ort) - { - case 1: // nothing - break; - - case 2: // horizontal flip - $this->flip(); - break; - - case 3: // 180 rotate left - $this->rotate(180); - break; - - case 4: // vertical flip - $this->flip(false, true); - break; - - case 5: // vertical flip + 90 rotate right - $this->flip(false, true); - $this->rotate(-90); - break; - - case 6: // 90 rotate right - $this->rotate(-90); - break; - - case 7: // horizontal flip + 90 rotate right - $this->flip(); - $this->rotate(-90); - break; - - case 8: // 90 rotate left - $this->rotate(90); - break; - } - } + $exif = @exif_read_data($filename); + if($exif) { + $ort = $exif['Orientation']; + + switch($ort) + { + case 1: // nothing + break; + + case 2: // horizontal flip + $this->flip(); + break; + + case 3: // 180 rotate left + $this->rotate(180); + break; + + case 4: // vertical flip + $this->flip(false, true); + break; + + case 5: // vertical flip + 90 rotate right + $this->flip(false, true); + $this->rotate(-90); + break; + + case 6: // 90 rotate right + $this->rotate(-90); + break; + + case 7: // horizontal flip + 90 rotate right + $this->flip(); + $this->rotate(-90); + break; + + case 8: // 90 rotate left + $this->rotate(90); + break; + } + } + } -- cgit v1.2.3