Exif.php: add exifOrientationOnSide

This commit is contained in:
Zankaria 2025-03-21 01:44:50 +01:00
parent 5e503af1e9
commit 72fcf970c3

View file

@ -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;
}
}