public function serverResponse()
    {
        try
        {
            $this->generator->serverResponse();
        }
        catch(\Exception $exception)
        {
            // Handle server generating image response exception
            if($this->handleExceptions)
            {
                if(is_string($this->handleExceptions))
                {
                    Debugger::log($exception->getMessage(), $this->handleExceptions);
                }
                else
                {
                    Debugger::log($exception, 'palette');
                }
            }
            else
            {
                throw $exception;
            }

            // Return fallback image on exception if fallback image is configured
            $fallbackImage = $this->generator->getFallbackImage();

            if($fallbackImage)
            {
                $paletteQuery = preg_replace('/.*@(.*)/', $fallbackImage . '@$1', $_GET['imageQuery']);

                $picture  = $this->generator->loadPicture($paletteQuery);
                $savePath = $this->generator->getPath($picture);

                if(!file_exists($savePath))
                {
                    $picture->save($savePath);
                }

                $picture->output();
            }
        }
    }
public function serverResponse()
    {
        try
        {
            $this->generator->serverResponse();
        }
        catch(\Exception $exception)
        {
            // Handle server generating image response exception
            if($this->handleExceptions)
            {
                if(is_string($this->handleExceptions))
                {
                    Debugger::log($exception->getMessage(), $this->handleExceptions);
                }
                else
                {
                    Debugger::log($exception, 'palette');
                }
            }
            else
            {
                throw $exception;
            }

            // Return fallback image on exception if fallback image is configured
            $fallbackImage = $this->generator->getFallbackImage();

            if($fallbackImage)
            {
                $paletteQuery = preg_replace('/.*@(.*)/', $fallbackImage . '@$1', $_GET['imageQuery']);

                $picture  = $this->generator->loadPicture($paletteQuery);
                $savePath = $this->generator->getPath($picture);

                if(!file_exists($savePath))
                {
                    $picture->save($savePath);
                }

                $picture->output();
            }
        }
    }
public function serverResponse ( ) { try { $ this -> generator -> serverResponse ( ) ; } catch ( \ Exception $ exception ) { // Handle server generating image response exception if ( $ this -> handleExceptions ) { if ( is_string ( $ this -> handleExceptions ) ) { Debugger :: log ( $ exception -> getMessage ( ) , $ this -> handleExceptions ) ; } else { Debugger :: log ( $ exception , 'palette' ) ; } } else { throw $ exception ; } // Return fallback image on exception if fallback image is configured $ fallbackImage = $ this -> generator -> getFallbackImage ( ) ; if ( $ fallbackImage ) { $ paletteQuery = preg_replace ( '/.*@(.*)/' , $ fallbackImage . '@$1' , $ _GET [ 'imageQuery' ] ) ; $ picture = $ this -> generator -> loadPicture ( $ paletteQuery ) ; $ savePath = $ this -> generator -> getPath ( $ picture ) ; if ( ! file_exists ( $ savePath ) ) { $ picture -> save ( $ savePath ) ; } $ picture -> output ( ) ; } } }
Execute palette service generator backend
Execute palette service generator backend