src/helpers/Storage.php
public static function getImageResolution($filePath, $throwException = false)
    {
        $dimensions = @getimagesize(Yii::getAlias($filePath));
        
        $width = 0;
        $height = 0;
        
        if (isset($dimensions[0]) && isset($dimensions[1])) {
            $width = (int)$dimensions[0];
            $height = (int)$dimensions[1];
        } elseif ($throwException) {
            throw new Exception("Unable to determine the resoltuions of the file $filePath.");
        }
        
        return [
            'width' => $width,
            'height' => $height,
        ];
    }
public static function getImageResolution($filePath, $throwException = false)
    {
        $dimensions = @getimagesize(Yii::getAlias($filePath));
        
        $width = 0;
        $height = 0;
        
        if (isset($dimensions[0]) && isset($dimensions[1])) {
            $width = (int)$dimensions[0];
            $height = (int)$dimensions[1];
        } elseif ($throwException) {
            throw new Exception("Unable to determine the resoltuions of the file $filePath.");
        }
        
        return [
            'width' => $width,
            'height' => $height,
        ];
    }
public static function getImageResolution ( $ filePath , $ throwException = false ) { $ dimensions = @ getimagesize ( Yii :: getAlias ( $ filePath ) ) ; $ width = 0 ; $ height = 0 ; if ( isset ( $ dimensions [ 0 ] ) && isset ( $ dimensions [ 1 ] ) ) { $ width = ( int ) $ dimensions [ 0 ] ; $ height = ( int ) $ dimensions [ 1 ] ; } elseif ( $ throwException ) { throw new Exception ( "Unable to determine the resoltuions of the file $filePath." ) ; } return [ 'width' => $ width , 'height' => $ height , ] ; }
Get the image resolution of a given file path.

@param string $filePath
@param bool $throwException
@return array
@throws Exception
Get the image resolution of a given file path .