exif_read_data may not be available and isn't a requirement - check and silently ignore exif orientation if it isn't there

This commit is contained in:
friendica 2012-06-18 20:21:54 -07:00
parent 633726e4a9
commit dbceef04e8

View file

@ -143,6 +143,9 @@ class Photo {
public function orient($filename) { public function orient($filename) {
// based off comment on http://php.net/manual/en/function.imagerotate.php // based off comment on http://php.net/manual/en/function.imagerotate.php
if(! function_exists('exif_read_data'))
return;
$exif = exif_read_data($filename); $exif = exif_read_data($filename);
$ort = $exif['Orientation']; $ort = $exif['Orientation'];