DimensionsTrait
trait DimensionsTrait (View source)
Trait for methods regarding the dimensions of an asset
Properties
| protected int | $width | ||
| protected int | $height | 
Methods
Width of the image in pixels
Height of the image in pixels
Does the asset have dimensions
Edge / aspect ratio of the image
Orientation of this image, i.e. portrait, landscape or square
Whether this image is square aspect ratio and therefore has a square orientation
Whether this image is in landscape orientation
Whether this image is in portrait orientation
Details
        
                            int
    getWidth()
        
    
    Width of the image in pixels
        
                            int
    getHeight()
        
    
    Height of the image in pixels
        
                            bool
    hasDimensions()
        
    
    Does the asset have dimensions
        
                            float
    getAspectRatio(bool $respectOrientation = false)
        
    
    Edge / aspect ratio of the image
        
                            string
    getOrientation()
        
    
    Orientation of this image, i.e. portrait, landscape or square
        
                            bool
    isOrientationSquare()
        
    
    Whether this image is square aspect ratio and therefore has a square orientation
        
                            bool
    isOrientationLandscape()
        
    
    Whether this image is in landscape orientation
        
                            bool
    isOrientationPortrait()
        
    
    Whether this image is in portrait orientation