PHP code example of vampyrian / image-resizer
1. Go to this page and download the library: Download vampyrian/image-resizer 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/ */
vampyrian / image-resizer example snippets
$path = ImageResizer::load($pathToImage)->setWidth(100)->setHeight(100)->saveAndReturnPath();
$path = ImageResizer::load($pathToImage)->setWidthAndHeight(100, 100)->saveAndReturnPath();
$path = ImageResizer::load($pathToImage)->setWidthAndHeight(100, 100)->dirToSave('thumb')->saveAndReturnPath();