PHP code example of fixmind / img-adjuster
1. Go to this page and download the library: Download fixmind/img-adjuster 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/ */
fixmind / img-adjuster example snippets
// EXAMPLE 01
$imgAdjuster = new ImgAdjuster('source.jpeg');
$imgAdjuster->config()->setBw(false)->setQuality(90);
$imgAdjuster->saveAs('destination_01.jpg');
// EXAMPLE 02
$imgAdjuster->config()->setBw(true);
$imgAdjuster->resize()->toLonger(300)->setPosition(Horizontal::CENTER(), Vertical::MIDDLE());
$imgAdjuster->watermark()->setSrc('logo.png')->setPosition(Horizontal::CENTER(), Vertical::MIDDLE())->setAlpha(20)->setSize(20);
$imgAdjuster->saveAs('destination_02.jpg');
// EXAMPLE 03
$watermark = (new Watermark())->setSrc('logo.png')->setPosition(Horizontal::CENTER(), Vertical::TOP())->setAlpha(50);
$resize = (new Resize())->setFit(400, 300);
$imgAdjuster->config()->setWatermark($watermark)->setSize($resize);
$imgAdjuster->saveAs('destination_03.jpg'):