slaxweb/image-processor

Image processing

0.1.1 2016-04-18 10:23 UTC

This package is not auto-updated.

Last update: 2024-04-23 05:48:19 UTC


README

Image manipulation using PHP ImageMagick. Functionality is added as is needed. More of just a wrapper around ImageMagick for easier use.

How to use

Initialization

To initialize the Image class, the config class must be initialized, which only holds the image save path at the moment. When initialized, it needs to be passed as the parameter to the Image class constructor. If using composer, just include the autoloader, if not, include the classes in your scripts.

$config = new \SlaxWeb\ImageProcessor\ConfigImage();
$config->path("/path/to/images");
// or $config->path = "/path/to/images/";
$image = new \SlaxWeb\ImageProcessor\Image($config);

If you did not include the config at initialization, you can call it later, or if you want to change the config.

$image->setConfig($config);

Loading the image

You can either load the image from a file:

$image->loadImage("imagename.jpg");

Or from a base64 string:

$image->loadImageBase64($base64String);

To be continued...