Skip to content

Commit

Permalink
Fix: Handle all exif rotation states
Browse files Browse the repository at this point in the history
  • Loading branch information
axllent committed Nov 15, 2024
1 parent 270fcde commit 6adbb6d
Showing 1 changed file with 3 additions and 21 deletions.
24 changes: 3 additions & 21 deletions src/ScaledUploads.php
Original file line number Diff line number Diff line change
Expand Up @@ -212,11 +212,11 @@ private function scaleUploadedImage($file)
}

/**
* exifRotation - return the exif rotation
* ExifRotation - return the exif rotation
*
* @param mixed $file Physical file path
*
* @return int false|angle
* @return int bool
*/
private function exifRotation($file)
{
Expand All @@ -236,24 +236,6 @@ private function exifRotation($file)
$ort = @$exif['Orientation'];
}

switch ($ort) {
case 3: // image upside down
return '180';

break;

case 6: // 90 rotate right
return '-90';

break;

case 8: // 90 rotate left
return '90';

break;

default:
return false;
}
return $ort > 0;
}
}

0 comments on commit 6adbb6d

Please sign in to comment.