Skip to content

Commit

Permalink
[php:plugins:AutoRotate] hide Warning error in rotate()
Browse files Browse the repository at this point in the history
  • Loading branch information
nao-pon committed Feb 2, 2020
1 parent 3099855 commit a35eabc
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions php/plugins/AutoRotate/plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,10 @@ private function rotate($volume, $src, $srcImgInfo, $quality)
return false;
}
$degree = 0;
$errlev =error_reporting();
error_reporting($errlev ^ E_WARNING);
$exif = exif_read_data($src);
error_reporting($errlev);
if ($exif && !empty($exif['Orientation'])) {
switch ($exif['Orientation']) {
case 8:
Expand All @@ -128,6 +131,9 @@ private function rotate($volume, $src, $srcImgInfo, $quality)
break;
}
}
if (!$degree) {
return false;
}
$opts = array(
'degree' => $degree,
'jpgQuality' => $quality,
Expand Down

0 comments on commit a35eabc

Please sign in to comment.