public function crop(array $croppable, $index = 0)
    {
        $coordinates = $croppable['coordinates'][$index];

        $file = new UploadableFile($this->root_path, $croppable['image']);
        $name = $this->makeCropName($file, $coordinates);
        $path = $file->getRootPath() . $name;

        if (!file_exists($path)) {
            $this->doCrop($file, $coordinates, $path);
        }

        return $name;
    }
public function crop(array $croppable, $index = 0)
    {
        $coordinates = $croppable['coordinates'][$index];

        $file = new UploadableFile($this->root_path, $croppable['image']);
        $name = $this->makeCropName($file, $coordinates);
        $path = $file->getRootPath() . $name;

        if (!file_exists($path)) {
            $this->doCrop($file, $coordinates, $path);
        }

        return $name;
    }
public function crop ( array $ croppable , $ index = 0 ) { $ coordinates = $ croppable [ 'coordinates' ] [ $ index ] ; $ file = new UploadableFile ( $ this -> root_path , $ croppable [ 'image' ] ) ; $ name = $ this -> makeCropName ( $ file , $ coordinates ) ; $ path = $ file -> getRootPath ( ) . $ name ; if ( ! file_exists ( $ path ) ) { $ this -> doCrop ( $ file , $ coordinates , $ path ) ; } return $ name ; }
Crops a file and returns crop's web path

@param array $croppable
@param int $index
@return mixed
Crops a file and returns crop s web path