Asido Drivers

The main advantage of Asido is to have a common and solid API for image transformations no matter what environment you got. This is achived by using the so-called „drivers“, which utilize the selected environment to always deliver the same result. There are drivers for either PHP extensions like php_gd, php_imagick, php_magickwand, or php_imlib (not yet supported), as well as shell tools like Image Magick, NetPBM and ImLib2 (so far only Image Magick is supported as shell driver).

Ordinary Drivers


Asido supports the following environments:

GD2

This is the most common environment. In order to use it, you got to have the php_gd.dll (gd.so) extension loaded (more info).
/**
* Enable the GD driver
*/
asido::driver('gd');
The GD driver has a hack version, which enables flipping (vertical mirror), flopping (horizontal mirror), and grayscaling.

MagickWand

MagickWand is a native PHP-extension to the ImageMagick MagickWand API. This is the (most recent, read official) ImageMagick API for PHP and it is the recomended ImageMagick API for using with PHP. In order to use it, you got to have the php_magickwand.dll (magickwand.so) extension loaded (more info).
/**
* Enable the Magick Wand driver
*/
asido::driver('magick_wand');
The old ImageMagick API is still available when using the php_imagick extension.

Imagick extension

Imagick extension is a native PHP-extension to the ImageMagick API. This is the „old“ ImageMagick API for PHP, but it is still present in all the latest PHP builds. In order to use it, you got to have the php_imagick.dll (imagick.so) extension loaded (more info).

/**
* Enable the Imagick Extension driver
*/
asido::driver('imagick_ext');

The imagick_ext driver has a hack version, which enables fully-featured rotating and somewhat version of grayscaling.

Imagick shell

This driver utilizes the CLI commands of ImageMagick (more info).

/**
* Enable the Imagick Shell driver
*/
asido::driver('imagick_shell');

The imagick_shell driver has a hack version, which enables fully-featured rotating.

Hack Drivers


In several occasions, some particular environment can not deliver some of the required functionality. For these scenarios there is a family of drivers, called the „hack“ drivers. Those drivers have work-arounds for the missing functionalities using whatever they can find useful from the features of the environment. All those work-arounds are functional, but they are not as fast as the „core“ implementations of the ordinary drivers. Here are the „hack“ drivers and the applied work-arounds: