public function handleRequest($preset_key, $file)
    {
        //do it at the beginning for early validation
        $preset = $this->getPresetActions($preset_key, $file);

        $source_file =  $this->getOriginalFilename($file);

        $original_file = $this->getOriginalFile($source_file);

        $final_file = $this->localUrl($preset_key, $file);

        $this->verifyDirectoryExistence($this->options['path_local'], dirname($final_file));

        $final_file = $this->options['path_local'] . '/' . $final_file;

        if (file_exists($final_file)) {
            return $final_file;
        }

        $image = $this->loadImage($original_file);

        return $this->buildImage($preset, $image, $final_file)->source;
    }
public function handleRequest($preset_key, $file)
    {
        //do it at the beginning for early validation
        $preset = $this->getPresetActions($preset_key, $file);

        $source_file =  $this->getOriginalFilename($file);

        $original_file = $this->getOriginalFile($source_file);

        $final_file = $this->localUrl($preset_key, $file);

        $this->verifyDirectoryExistence($this->options['path_local'], dirname($final_file));

        $final_file = $this->options['path_local'] . '/' . $final_file;

        if (file_exists($final_file)) {
            return $final_file;
        }

        $image = $this->loadImage($original_file);

        return $this->buildImage($preset, $image, $final_file)->source;
    }
public function handleRequest ( $ preset_key , $ file ) { //do it at the beginning for early validation $ preset = $ this -> getPresetActions ( $ preset_key , $ file ) ; $ source_file = $ this -> getOriginalFilename ( $ file ) ; $ original_file = $ this -> getOriginalFile ( $ source_file ) ; $ final_file = $ this -> localUrl ( $ preset_key , $ file ) ; $ this -> verifyDirectoryExistence ( $ this -> options [ 'path_local' ] , dirname ( $ final_file ) ) ; $ final_file = $ this -> options [ 'path_local' ] . '/' . $ final_file ; if ( file_exists ( $ final_file ) ) { return $ final_file ; } $ image = $ this -> loadImage ( $ original_file ) ; return $ this -> buildImage ( $ preset , $ image , $ final_file ) -> source ; }
Take a preset and a file and return a transformed image

@param $preset_key string
@param $file string
@throws Exceptions\InvalidPresetException
@throws Exceptions\NotFoundException
@throws \RuntimeException
@return string
Take a preset and a file and return a transformed image