public function resizeExactWidth(&$image, $newWidth)
    {

        $width  = $image->getWidth();
        $height = $image->getHeight();
        $ratio  = $width / $height;

        $resizeWidth  = $newWidth;
        $resizeHeight = round($newWidth / $ratio);

        $this->_resize($image, $resizeWidth, $resizeHeight);

        return $this;
    }
public function resizeExactWidth(&$image, $newWidth)
    {

        $width  = $image->getWidth();
        $height = $image->getHeight();
        $ratio  = $width / $height;

        $resizeWidth  = $newWidth;
        $resizeHeight = round($newWidth / $ratio);

        $this->_resize($image, $resizeWidth, $resizeHeight);

        return $this;
    }
public function resizeExactWidth ( & $ image , $ newWidth ) { $ width = $ image -> getWidth ( ) ; $ height = $ image -> getHeight ( ) ; $ ratio = $ width / $ height ; $ resizeWidth = $ newWidth ; $ resizeHeight = round ( $ newWidth / $ ratio ) ; $ this -> _resize ( $ image , $ resizeWidth , $ resizeHeight ) ; return $ this ; }
Resize image to exact width. Height is auto calculated. Useful for creating column of images with the same width.

@param Image $image
@param int $newWidth Width in pixels.

@return self
Resize image to exact width . Height is auto calculated . Useful for creating column of images with the same width .