src/Support/Image/Resizer.php
protected function resizeAuto(ImageInterface $image, $width, $height)
    {
        $size = $image->getSize();
        $originalWidth = $size->getWidth();
        $originalHeight = $size->getHeight();

        if ($originalHeight < $originalWidth) {
            return $this->resizeLandscape($image, $width, $height);
        }

        if ($originalHeight > $originalWidth) {
            return $this->resizePortrait($image, $width, $height);
        }

        if ($height < $width) {
            return $this->resizeLandscape($image, $width, $height);
        }

        if ($height > $width) {
            return $this->resizePortrait($image, $width, $height);
        }

        return $this->resizeExact($image, $width, $height);
    }
protected function resizeAuto(ImageInterface $image, $width, $height)
    {
        $size = $image->getSize();
        $originalWidth = $size->getWidth();
        $originalHeight = $size->getHeight();

        if ($originalHeight < $originalWidth) {
            return $this->resizeLandscape($image, $width, $height);
        }

        if ($originalHeight > $originalWidth) {
            return $this->resizePortrait($image, $width, $height);
        }

        if ($height < $width) {
            return $this->resizeLandscape($image, $width, $height);
        }

        if ($height > $width) {
            return $this->resizePortrait($image, $width, $height);
        }

        return $this->resizeExact($image, $width, $height);
    }
protected function resizeAuto ( ImageInterface $ image , $ width , $ height ) { $ size = $ image -> getSize ( ) ; $ originalWidth = $ size -> getWidth ( ) ; $ originalHeight = $ size -> getHeight ( ) ; if ( $ originalHeight < $ originalWidth ) { return $ this -> resizeLandscape ( $ image , $ width , $ height ) ; } if ( $ originalHeight > $ originalWidth ) { return $ this -> resizePortrait ( $ image , $ width , $ height ) ; } if ( $ height < $ width ) { return $ this -> resizeLandscape ( $ image , $ width , $ height ) ; } if ( $ height > $ width ) { return $ this -> resizePortrait ( $ image , $ width , $ height ) ; } return $ this -> resizeExact ( $ image , $ width , $ height ) ; }
Resize an image as closely as possible to a given width and height while still maintaining aspect ratio

This method is really just a proxy to other resize methods:.

If the current image is wider than it is tall, we'll resize landscape.
If the current image is taller than it is wide, we'll resize portrait.
If the image is as tall as it is wide (it's a squarey) then we'll
apply the same process using the new dimensions (we'll resize exact if
the new dimensions are both equal since at this point we'll have a square
image being resized to a square).

@param ImageInterface $image
@param string         $width     new width
@param string         $height    new height
@return ImageInterface
Resize an image as closely as possible to a given width and height while still maintaining aspect ratio