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).

MagickWand: this is a native PHP-extension to the ImageMagickMagickWand 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: this 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).

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:

As with the extension version above, for this hack driver the extra touch added is setting the background color of the rotated object.

To do

There are still several options left for designing more drivers – there are still environments that need to be covered by an Asido driver. However, they are not as frequently used as the ones above. That’s why we are going to postpone them for now and not implement them. To see a detailed roadmap of what’s planned for Asido, check the Asido roadmap.