1. Go to this page and download the library: Download vishal-pawar/image-convert 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/ */
vishal-pawar / image-convert example snippets
use VishalPawar\ImageConvert\helper\ImageHelper;
// Convert and save as WebP
$result = ImageHelper::saveWebpImage("uploads/images", $request->image);
// Resize and convert to WebP
$result = ImageHelper::resizeSaveWebpImage("uploads/images", $request->image, 800, 600);
// Save to object storage
ImageHelper::saveWebpImage("uploads/posts", $request->image, true);
// Resize and save to object storage
ImageHelper::resizeSaveWebpImage("uploads/posts", $request->image, 800, 600, true);