ImageInterface::createNew

public ImageInterface::createNew($width, $height, $extension = 'png', $transparent_color = '#ffffff') Prepares a new image, without loading it from a file. For a working example, see \Drupal\system\Plugin\ImageToolkit\Operation\gd\CreateNew. Parameters int $width: The width of the new image, in pixels. int $height: The height of the new image, in pixels. string $extension: (optional) The extension of the image file (for instance, 'png', 'gif', etc.). Allowed values depend on the implementation

ImageInterface::convert

public ImageInterface::convert($extension) Instructs the toolkit to save the image in the format specified by the extension. Parameters string $extension: The extension to convert to (for instance, 'jpeg' or 'png'). Allowed values depend on the current image toolkit. Return value bool TRUE on success, FALSE on failure. See also \Drupal\Core\ImageToolkit\ImageToolkitInterface::getSupportedExtensions() File core/lib/Drupal/Core/Image/ImageInterface.php, line 185 Class ImageInterface Provi

ImageInterface::apply

public ImageInterface::apply($operation, array $arguments = array()) Applies a toolkit operation to the image. The operation is deferred to the active toolkit. Parameters string $operation: The operation to be performed against the image. array $arguments: (optional) An associative array of arguments to be passed to the toolkit operation; for instance, ['width' => 50, 'height' => 100, 'upscale' => TRUE] Defaults to an empty array. Return value bool TRUE on success, FALSE on f

ImageInterface

Provides an interface for image objects. Hierarchy interface \Drupal\Core\Image\ImageInterface File core/lib/Drupal/Core/Image/ImageInterface.php, line 8 Namespace Drupal\Core\Image Members Name Modifiers Type Description ImageInterface::apply public function Applies a toolkit operation to the image. ImageInterface::convert public function Instructs the toolkit to save the image in the format specified by the extension. ImageInterface::createNew public func

ImageFactory::__construct

public ImageFactory::__construct(ImageToolkitManager $toolkit_manager) Constructs a new ImageFactory object. Parameters \Drupal\Core\ImageToolkit\ImageToolkitManager $toolkit_manager: The image toolkit plugin manager. File core/lib/Drupal/Core/Image/ImageFactory.php, line 32 Class ImageFactory Provides a factory for image objects. Namespace Drupal\Core\Image Code public function __construct(ImageToolkitManager $toolkit_manager) { $this->toolkitManager = $toolkit_manager; $this-

ImageFactory::setToolkitId

public ImageFactory::setToolkitId($toolkit_id) Sets the ID of the image toolkit. Parameters string $toolkit_id: The ID of the image toolkit to use for this image factory. Return value $this File core/lib/Drupal/Core/Image/ImageFactory.php, line 45 Class ImageFactory Provides a factory for image objects. Namespace Drupal\Core\Image Code public function setToolkitId($toolkit_id) { $this->toolkitId = $toolkit_id; return $this; }

ImageFactory::getToolkitId

public ImageFactory::getToolkitId() Gets the ID of the image toolkit currently in use. Return value string The ID of the image toolkit in use by the image factory. File core/lib/Drupal/Core/Image/ImageFactory.php, line 56 Class ImageFactory Provides a factory for image objects. Namespace Drupal\Core\Image Code public function getToolkitId() { return $this->toolkitId; }

ImageFactory::getSupportedExtensions

public ImageFactory::getSupportedExtensions($toolkit_id = NULL) Returns the image file extensions supported by the toolkit. Parameters string|null $toolkit_id: (optional) The ID of the image toolkit to use for checking, or NULL to use the current toolkit. Return value array An array of supported image file extensions (e.g. png/jpeg/gif). See also \Drupal\Core\ImageToolkit\ImageToolkitInterface::getSupportedExtensions() File core/lib/Drupal/Core/Image/ImageFactory.php, line 100 Class Imag

ImageFactory::get

public ImageFactory::get($source = NULL, $toolkit_id = NULL) Constructs a new Image object. Normally, the toolkit set as default in the admin UI is used by the factory to create new Image objects. This can be overridden through \Drupal\Core\Image\ImageInterface::setToolkitId() so that any new Image object created will use the new toolkit specified. Finally, a single Image object can be created using a specific toolkit, regardless of the current factory settings, by passing its plugin ID in the

ImageFactory::$toolkitManager

The image toolkit plugin manager. Type: \Drupal\Core\ImageToolkit\ImageToolkitManager File core/lib/Drupal/Core/Image/ImageFactory.php, line 17 Class ImageFactory Provides a factory for image objects. Namespace Drupal\Core\Image Code protected $toolkitManager;