PHP code example of digitalkreativ / php-simple-gif-transitions
1. Go to this page and download the library: Download digitalkreativ/php-simple-gif-transitions library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
digitalkreativ / php-simple-gif-transitions example snippets
try {
$config = new \Digitalkreativ\SimpleGifTransitions\Library\Config();
$config->setTempDirectory( '<full-path-to-tmp-dir>' )
->setDebug( true )
->setImageDriver( \Digitalkreativ\SimpleGifTransitions\Library\Config::IMAGE_DRIVER_GD );
$generator = new \Digitalkreativ\SimpleGifTransitions\GifGenerator( $config );
$generator->setScenario( new \Digitalkreativ\SimpleGifTransitions\Scenarios\RevealSlideBottom() );
$generator->setFromImage( '<full-path-to-jpg>' )
->setToImage( '<full-path-to-jpg>' )
->generate( '<full-path-to-jpg-to-generate>' );
} catch ( Exception $ex ){
echo $ex->getMessage() . PHP_EOL;
}