src/Manipulators/Size.php
public function limitImageSize($width, $height)
    {
        if ($this->maxImageSize !== null) {
            $imageSize = $width * $height;

            if ($imageSize > $this->maxImageSize) {
                $width = $width / sqrt($imageSize / $this->maxImageSize);
                $height = $height / sqrt($imageSize / $this->maxImageSize);
            }
        }

        return [
            (int) $width,
            (int) $height,
        ];
    }
public function limitImageSize($width, $height)
    {
        if ($this->maxImageSize !== null) {
            $imageSize = $width * $height;

            if ($imageSize > $this->maxImageSize) {
                $width = $width / sqrt($imageSize / $this->maxImageSize);
                $height = $height / sqrt($imageSize / $this->maxImageSize);
            }
        }

        return [
            (int) $width,
            (int) $height,
        ];
    }
public function limitImageSize ( $ width , $ height ) { if ( $ this -> maxImageSize !== null ) { $ imageSize = $ width * $ height ; if ( $ imageSize > $ this -> maxImageSize ) { $ width = $ width / sqrt ( $ imageSize / $ this -> maxImageSize ) ; $ height = $ height / sqrt ( $ imageSize / $ this -> maxImageSize ) ; } } return [ ( int ) $ width , ( int ) $ height , ] ; }
Limit image size to maximum allowed image size.
@param  integer   $width  The image width.
@param  integer   $height The image height.
@return integer[] The limited width and height.
Limit image size to maximum allowed image size .