1. Go to this page and download the library: Download techart/image-service 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/ */
$imageUrl = $service->modify('путь до оригинальной картинки')
->setQuality(95)
->setSizes('800x600')
->setFormat('webp')
->setMethod('fit')
->process()
->getUrl()
$imageUrl = $service->modify('путь до оригинальной картинки', [
'resize' => '400x0',
'format' => 'webp',
'quality' => 80,
'method' => 'fit'
])->process()->getUrl()
$imageUrl = $service->setup('путь до оригинальной картинки', '/r/640x480/r/f/webp/f/q/80/q/m/fit/m')
->process()
->getUrl();
$originalImage = 'путь до оригинальной картинки';
$storage = $service->storage($originalImage);
if ($storage->haveModifyImages()) {
$storage->delete(false);
}
gumlet/php-image-resize
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.