gevo/sqip_img_converter

Converts image to placeholders using sqip

Installs: 5

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

pkg:composer/gevo/sqip_img_converter

v1.0.0 2024-02-24 10:41 UTC

This package is auto-updated.

Last update: 2025-12-24 15:21:13 UTC


README

This project provides a PHP class for converting images to SVG placeholders using Sqip.

Installation

Use composer to install the project:

composer require gevo/img-converter-sqip

Packagist link

Make sure to have sqip globally installed on your machine following the official guide

Usage

use Gevo\ImgConverterSqip\Converter;

$converter = new Converter($inputPath, $outputPath);
$converter->convert();

In this example, $inputPath is the path to the input image and $outputPath is the path where the SVG placeholder should be saved.

Exception Handling

The convert method may throw an ImgConverterSqipException if there's a problem during the conversion process. You should catch this exception in your code and handle it appropriately.

use Gevo\ImgConverterSqip\Converter;
use Gevo\ImgConverterSqip\ImgConverterSqipException;

try {
    $converter = new Converter($inputPath, $outputPath);
    $converter->convert();
} catch (ImgConverterSqipException $e) {
    // Handle exception
}

License

This project is licensed under the MIT License.