Back to Image class

Method getOrientationString

private static string
getOrientationString
(int $width, int $height)
Compare width and height integers to determine image orientation.
Parameters
  • int $width The width value to use for calculation
  • int $height The height value to use for calculation
Returns
  • string Orientation string
Since
  • 3.4.2
Class: Image
Project: Joomla

Method getOrientationString - Source code

/**
 * Compare width and height integers to determine image orientation.
 *
 * @param   integer  $width   The width value to use for calculation
 * @param   integer  $height  The height value to use for calculation
 *
 * @return  string   Orientation string
 *
 * @since   3.4.2
 */
private static function getOrientationString(int $width, int $height) : string
{
    switch (true) {
        case $width > $height:
            return self::ORIENTATION_LANDSCAPE;
        case $width < $height:
            return self::ORIENTATION_PORTRAIT;
        default:
            return self::ORIENTATION_SQUARE;
    }
}