public final function resizeMaxSideTo2( int $newLandscapeWidth, int $newPortraitHeight ) : bool
   {

      if ( $this->isPortrait() )
      {

         // Portrait format

         if ( $newPortraitHeight == $this->_height )
         {
            // No resizing required
            return false;
         }

         if ( $newPortraitHeight < $this->_height )
         {
            // Decrease the current size
            return $this->reduceMaxSideTo2( $newLandscapeWidth, $newPortraitHeight );
         }

         // Expand the current size
         return $this->expandMaxSideTo2( $newLandscapeWidth, $newPortraitHeight );

      }

      // Landscape format

      if ( $newLandscapeWidth == $this->_width )
      {
         // No resizing required
         return false;
      }

      if ( $newPortraitHeight < $this->_width )
      {
         // Decrease the current size
         return $this->reduceMaxSideTo2( $newLandscapeWidth, $newPortraitHeight );
      }

      // Expand the current size
      return $this->expandMaxSideTo2( $newLandscapeWidth, $newPortraitHeight );

   }
public final function resizeMaxSideTo2( int $newLandscapeWidth, int $newPortraitHeight ) : bool
   {

      if ( $this->isPortrait() )
      {

         // Portrait format

         if ( $newPortraitHeight == $this->_height )
         {
            // No resizing required
            return false;
         }

         if ( $newPortraitHeight < $this->_height )
         {
            // Decrease the current size
            return $this->reduceMaxSideTo2( $newLandscapeWidth, $newPortraitHeight );
         }

         // Expand the current size
         return $this->expandMaxSideTo2( $newLandscapeWidth, $newPortraitHeight );

      }

      // Landscape format

      if ( $newLandscapeWidth == $this->_width )
      {
         // No resizing required
         return false;
      }

      if ( $newPortraitHeight < $this->_width )
      {
         // Decrease the current size
         return $this->reduceMaxSideTo2( $newLandscapeWidth, $newPortraitHeight );
      }

      // Expand the current size
      return $this->expandMaxSideTo2( $newLandscapeWidth, $newPortraitHeight );

   }
public final function resizeMaxSideTo2 ( int $ newLandscapeWidth , int $ newPortraitHeight ) : bool { if ( $ this -> isPortrait ( ) ) { // Portrait format if ( $ newPortraitHeight == $ this -> _height ) { // No resizing required return false ; } if ( $ newPortraitHeight < $ this -> _height ) { // Decrease the current size return $ this -> reduceMaxSideTo2 ( $ newLandscapeWidth , $ newPortraitHeight ) ; } // Expand the current size return $ this -> expandMaxSideTo2 ( $ newLandscapeWidth , $ newPortraitHeight ) ; } // Landscape format if ( $ newLandscapeWidth == $ this -> _width ) { // No resizing required return false ; } if ( $ newPortraitHeight < $ this -> _width ) { // Decrease the current size return $ this -> reduceMaxSideTo2 ( $ newLandscapeWidth , $ newPortraitHeight ) ; } // Expand the current size return $ this -> expandMaxSideTo2 ( $ newLandscapeWidth , $ newPortraitHeight ) ; }
Resize the longest side to the defined length and also resize the shorter side to hold the proportion
of this size. The value, used as max side length is depending to the current size format.

$newLandscapeWidth is used if the current size uses a landscape ord quadratic format. Otherwise the
$newPortraitHeight is used.

@param  int $newLandscapeWidth Max. width for landscape format or quadratic format.
@param  int $newPortraitHeight Max. height for portrait format.
@return bool
@throws \Beluga\BelugaError  If the instance is set to fixed.
Resize the longest side to the defined length and also resize the shorter side to hold the proportion of this size . The value used as max side length is depending to the current size format .