public function cropImage($x, $y, $width, $height, $outputFormat, $outPath)
    {
        //check whether files are set or not
        if ($this->getFileName() == '')
            throw new Exception('Base file not specified');

        if ($x == '')
            throw new Exception('X position not specified');

        if ($y == '')
            throw new Exception('Y position not specified');

        if ($width == '')
            throw new Exception('Width not specified');

        if ($height == '')
            throw new Exception('Height not specified');

        if ($outputFormat == '')
            throw new Exception('Format not specified');

        if ($outPath == '')
            throw new Exception('Output file name not specified');

        //build URI
        $strURI = Product::$baseProductUri . '/imaging/' . $this->getFileName() . '/crop?x=' . $x . '&y=' . $y . '&width=' . $width . '&height=' . $height . '&format=' . $outputFormat . '&outPath=' . $outPath;

        //sign URI
        $signedURI = Utils::sign($strURI);

        $responseStream = Utils::processCommand($signedURI, 'GET', '', '');

        $v_output = Utils::validateOutput($responseStream);

        if ($v_output === '') {
            if ($outputFormat == 'html') {
                $saveFormat = 'zip';
            } else {
                $saveFormat = $outputFormat;
            }

            Utils::saveFile($responseStream, AsposeApp::$outPutLocation . $outPath);
            return $outPath;
        } else
            return $v_output;
    }
public function cropImage($x, $y, $width, $height, $outputFormat, $outPath)
    {
        //check whether files are set or not
        if ($this->getFileName() == '')
            throw new Exception('Base file not specified');

        if ($x == '')
            throw new Exception('X position not specified');

        if ($y == '')
            throw new Exception('Y position not specified');

        if ($width == '')
            throw new Exception('Width not specified');

        if ($height == '')
            throw new Exception('Height not specified');

        if ($outputFormat == '')
            throw new Exception('Format not specified');

        if ($outPath == '')
            throw new Exception('Output file name not specified');

        //build URI
        $strURI = Product::$baseProductUri . '/imaging/' . $this->getFileName() . '/crop?x=' . $x . '&y=' . $y . '&width=' . $width . '&height=' . $height . '&format=' . $outputFormat . '&outPath=' . $outPath;

        //sign URI
        $signedURI = Utils::sign($strURI);

        $responseStream = Utils::processCommand($signedURI, 'GET', '', '');

        $v_output = Utils::validateOutput($responseStream);

        if ($v_output === '') {
            if ($outputFormat == 'html') {
                $saveFormat = 'zip';
            } else {
                $saveFormat = $outputFormat;
            }

            Utils::saveFile($responseStream, AsposeApp::$outPutLocation . $outPath);
            return $outPath;
        } else
            return $v_output;
    }
public function cropImage ( $ x , $ y , $ width , $ height , $ outputFormat , $ outPath ) { //check whether files are set or not if ( $ this -> getFileName ( ) == '' ) throw new Exception ( 'Base file not specified' ) ; if ( $ x == '' ) throw new Exception ( 'X position not specified' ) ; if ( $ y == '' ) throw new Exception ( 'Y position not specified' ) ; if ( $ width == '' ) throw new Exception ( 'Width not specified' ) ; if ( $ height == '' ) throw new Exception ( 'Height not specified' ) ; if ( $ outputFormat == '' ) throw new Exception ( 'Format not specified' ) ; if ( $ outPath == '' ) throw new Exception ( 'Output file name not specified' ) ; //build URI $ strURI = Product :: $ baseProductUri . '/imaging/' . $ this -> getFileName ( ) . '/crop?x=' . $ x . '&y=' . $ y . '&width=' . $ width . '&height=' . $ height . '&format=' . $ outputFormat . '&outPath=' . $ outPath ; //sign URI $ signedURI = Utils :: sign ( $ strURI ) ; $ responseStream = Utils :: processCommand ( $ signedURI , 'GET' , '' , '' ) ; $ v_output = Utils :: validateOutput ( $ responseStream ) ; if ( $ v_output === '' ) { if ( $ outputFormat == 'html' ) { $ saveFormat = 'zip' ; } else { $ saveFormat = $ outputFormat ; } Utils :: saveFile ( $ responseStream , AsposeApp :: $ outPutLocation . $ outPath ) ; return $ outPath ; } else return $ v_output ; }
Crop Image with Format Change.

@param integer $x X position of start point for cropping rectangle.
@param integer $y Y position of start point for cropping rectangle.
@param integer $width Width of cropping rectangle.
@param integer $height Height of cropping rectangle.
@param string $outPath Name of the output file.

@return string Returns the file path.
@throws Exception
Crop Image with Format Change .