PHP code example of coffeecode / cropper
1. Go to this page and download the library: Download coffeecode/cropper 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/ */
coffeecode / cropper example snippets
$c = new \CoffeeCode\Cropper\Cropper("patch/to/cache");
echo "<img src='{$c->make("images/image.jpg", 500)}' alt='Happy Coffee' title='Happy Coffee'>";
echo "<img src='{$c->make("images/image.jpg", 500, 300)}' alt='Happy Coffee' title='Happy Coffee'>";
$c = new \CoffeeCode\Cropper\Cropper("patch/to/cache");
//flush by filename
$c->flush("images/image.jpg");
//flush cache folder
$c->flush();