diff --git a/inc/Data/Exif.php b/inc/Data/Exif.php index 77b1011c..caf9bb82 100644 --- a/inc/Data/Exif.php +++ b/inc/Data/Exif.php @@ -11,4 +11,14 @@ class Exif { public const EXIF_ORIENTATION_270_UPRIGHT = 7; public const EXIF_ORIENTATION_270_FLIPPED = 8; public const EXIF_ORIENTATION_UNDEFINED = 9; + + /** + * Should you switch width and height since the image is on the side? + * + * @param int $exif_orientation An EXIF_ORIENTATION_* constant. + * @return boolean + */ + public static function exifOrientationOnSide(int $exif_orientation): bool { + return $exif_orientation >= 5 && $exif_orientation <= 8; + } }