From 9e5fa5b9a9462bf4642b075db925f5b5ff799c2d Mon Sep 17 00:00:00 2001 From: friendica Date: Wed, 5 Sep 2012 04:02:30 -0700 Subject: [PATCH] ignore exif orientation if we can't parse the particular flavour of exif --- include/Photo.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/include/Photo.php b/include/Photo.php index 74d4c746d6..5b6e6d846c 100644 --- a/include/Photo.php +++ b/include/Photo.php @@ -295,7 +295,11 @@ class Photo { if( (! function_exists('exif_read_data')) || ($this->getType() !== 'image/jpeg') ) return; - $exif = exif_read_data($filename); + $exif = @exif_read_data($filename); + + if(! $exif) + return; + $ort = $exif['Orientation']; switch($ort) -- 2.39.5