BxDolImageResize::_resize PHP Method

_resize() public method

public _resize ( $sSrcImage, $sDstImage = '' )
    function _resize($sSrcImage, $sDstImage = '')
    {
        $this->_sError = '';
        try {
            if ($this->_isAutoCrop || $this->_isSquareResize) {
                $this->_oManager->make($sSrcImage)->orientate()->fit($this->w, $this->_isSquareResize ? $this->w : $this->h, null, 'top')->save($sDstImage ? $sDstImage : $sSrcImage, $this->_iJpegQuality);
            } else {
                $this->_oManager->make($sSrcImage)->orientate()->resize($this->w, $this->h, function ($constraint) {
                    $constraint->aspectRatio();
                    $constraint->upsize();
                })->save($sDstImage ? $sDstImage : $sSrcImage, $this->_iJpegQuality);
            }
            chmod($sDstImage ? $sDstImage : $sSrcImage, BX_DOL_FILE_RIGHTS);
        } catch (Exception $e) {
            $this->_sError = $e->getMessage();
            return IMAGE_ERROR_WRONG_TYPE;
        }
        return IMAGE_ERROR_SUCCESS;
    }