karster/mozify

1.1 2022-08-16 08:37 UTC

This package is auto-updated.

Last update: 2024-11-16 13:36:14 UTC


README

Build Status Latest Stable Version GitHub license

Email client blocks images by default. Mozify is way how to serve images to your customers.

Installation

The preferred way to install this extension is through composer.

Either run

composer require karster/mozify:"*"

or add

"karster/mozify": "*"

to the require section of your composer.json.

Usage

use karster\image\Mozify;

$mozify = new Mozify();
$result = $mozify->setImageSrc('path/to/image.jpg')
        ->setSearchWindow(10)
        ->setColorDepth(8)
        ->setTest(true)
        ->generate();

echo $result;

To change image dimensions set width or height. Second attribute will calculate from image ratio.

use karster\image\Mozify;

$mozify = new Mozify();
$result = $mozify->setImageSrc('path/to/image.jpg')
        ->setSearchWindow(10)
        ->setColorDepth(8)
        ->setWidth(500)
        //->setHeight(300)
        ->generate();

echo $result;

Safari

Coffee

Tests

./vendor/bin/phpunit -c phpunit.xml

Contribution

Have an idea? Found a bug? See how to contribute.

License

MIT see LICENSE for the full license text.