private function get_dimensions($newWidth, $newHeight, $option)
        {
            switch ($option) {
                case 'exact':
                    $optimalWidth  = $newWidth;
                    $optimalHeight = $newHeight;
                    break;
                case 'portrait':
                    $optimalWidth  = $this->getSizeByFixedHeight($newHeight);
                    $optimalHeight = $newHeight;
                    break;
                case 'landscape':
                    $optimalWidth  = $newWidth;
                    $optimalHeight = $this->getSizeByFixedWidth($newWidth);
                    break;
                case 'auto':
                    $option_array   = $this->getSizeByAuto($newWidth, $newHeight);
                    $optimalWidth   = $option_array['optimalWidth'];
                    $optimalHeight  = $option_array['optimalHeight'];
                    break;
                case 'fit':
                    $option_array   = $this->getSizeByFit($newWidth, $newHeight);
                    $optimalWidth   = $option_array['optimalWidth'];
                    $optimalHeight  = $option_array['optimalHeight'];
                    break;
                case 'crop':
                    $option_array   = $this->getOptimalCrop($newWidth, $newHeight);
                    $optimalWidth   = $option_array['optimalWidth'];
                    $optimalHeight  = $option_array['optimalHeight'];
                    break;
            }

            return array(
                'optimalWidth'     => $optimalWidth,
                'optimalHeight'    => $optimalHeight
           );
        }
private function get_dimensions($newWidth, $newHeight, $option)
        {
            switch ($option) {
                case 'exact':
                    $optimalWidth  = $newWidth;
                    $optimalHeight = $newHeight;
                    break;
                case 'portrait':
                    $optimalWidth  = $this->getSizeByFixedHeight($newHeight);
                    $optimalHeight = $newHeight;
                    break;
                case 'landscape':
                    $optimalWidth  = $newWidth;
                    $optimalHeight = $this->getSizeByFixedWidth($newWidth);
                    break;
                case 'auto':
                    $option_array   = $this->getSizeByAuto($newWidth, $newHeight);
                    $optimalWidth   = $option_array['optimalWidth'];
                    $optimalHeight  = $option_array['optimalHeight'];
                    break;
                case 'fit':
                    $option_array   = $this->getSizeByFit($newWidth, $newHeight);
                    $optimalWidth   = $option_array['optimalWidth'];
                    $optimalHeight  = $option_array['optimalHeight'];
                    break;
                case 'crop':
                    $option_array   = $this->getOptimalCrop($newWidth, $newHeight);
                    $optimalWidth   = $option_array['optimalWidth'];
                    $optimalHeight  = $option_array['optimalHeight'];
                    break;
            }

            return array(
                'optimalWidth'     => $optimalWidth,
                'optimalHeight'    => $optimalHeight
           );
        }
private function get_dimensions ( $ newWidth , $ newHeight , $ option ) { switch ( $ option ) { case 'exact' : $ optimalWidth = $ newWidth ; $ optimalHeight = $ newHeight ; break ; case 'portrait' : $ optimalWidth = $ this -> getSizeByFixedHeight ( $ newHeight ) ; $ optimalHeight = $ newHeight ; break ; case 'landscape' : $ optimalWidth = $ newWidth ; $ optimalHeight = $ this -> getSizeByFixedWidth ( $ newWidth ) ; break ; case 'auto' : $ option_array = $ this -> getSizeByAuto ( $ newWidth , $ newHeight ) ; $ optimalWidth = $ option_array [ 'optimalWidth' ] ; $ optimalHeight = $ option_array [ 'optimalHeight' ] ; break ; case 'fit' : $ option_array = $ this -> getSizeByFit ( $ newWidth , $ newHeight ) ; $ optimalWidth = $ option_array [ 'optimalWidth' ] ; $ optimalHeight = $ option_array [ 'optimalHeight' ] ; break ; case 'crop' : $ option_array = $ this -> getOptimalCrop ( $ newWidth , $ newHeight ) ; $ optimalWidth = $ option_array [ 'optimalWidth' ] ; $ optimalHeight = $ option_array [ 'optimalHeight' ] ; break ; } return array ( 'optimalWidth' => $ optimalWidth , 'optimalHeight' => $ optimalHeight ) ; }
Return the image dimensions based on the option that was chosen.
@param  int    $newWidth  The width of the image
@param  int    $newHeight The height of the image
@param  string $option     Either exact, portrait, landscape, auto or crop.
@return array
Return the image dimensions based on the option that was chosen .