Images
In this section, we are going a bit deeper into the world of images in Drupal while keeping the focus on module developers.
Image toolkits
The Drupal Image toolkits provide an abstraction layer over the most common operations used for manipulating images. By default, Drupal uses the GD image management library that is included with PHP. However, it also offers the ability to switch to a different library if needed by using the ImageToolkit
plugins:
Figure 16.3: Image toolkit configuration UI
For instance, a contributed module could implement the ImageMagick
library for developers who need support for additional image types, such as TIFF, which GD does not support. However, only one library can be used at a time as it needs to be configured site-wide.
Programmatically manipulating images using a toolkit involves instantiating an ImageInterface
object that wraps an image file. This interface (implemented by the Image
class) contains...