PHP code example of bhsec / simpleimage

1. Go to this page and download the library: Download bhsec/simpleimage 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/ */

    

bhsec / simpleimage example snippets




ar1984\Fortune;

// configuration
$query = 'Dark'; // background query
$waterMark = 'Generated by simpleimage';
$paragraf = isset($argv[1]) ? $argv[1] : Fortune\Fortune::make(Fortune\Fortune::TERRY_DAVIS); // will use random fortune if argument is empty
$optionQuote = [
    'text' => $paragraf,
    'watermark' => $waterMark,
    'query' => $query,
    'font' => 'Shadow Brush.ttf',
    'result' => [
        'output' => 'quote.jpg',
        'mime' => 'image/jpeg',
        'quality' => 100, // 100%
    ],
];


$result = \Bhsec\SimpleImage\Templates\QuoteTemplates::make($optionQuote); // generate images
var_dump($result);