Back to Image class

Method getOrientation

public mixed
getOrientation
()
Method to detect whether an image's orientation is landscape, portrait or square.
Returns
  • mixed Orientation string or null.
Since
  • 3.4.2
Class: Image
Project: Joomla

Method getOrientation - Source code

/**
 * Method to detect whether an image's orientation is landscape, portrait or square.
 *
 * The orientation will be returned as a string.
 *
 * @return  mixed   Orientation string or null.
 *
 * @since   3.4.2
 */
public function getOrientation()
{
    if ($this->isLoaded()) {
        return self::getOrientationString($this->getWidth(), $this->getHeight());
    }
    return null;
}