diff --git a/core/lib/Drupal/Core/ImageToolkit/ImageToolkitBase.php b/core/lib/Drupal/Core/ImageToolkit/ImageToolkitBase.php index c17a61f..f08d6da 100644 --- a/core/lib/Drupal/Core/ImageToolkit/ImageToolkitBase.php +++ b/core/lib/Drupal/Core/ImageToolkit/ImageToolkitBase.php @@ -45,13 +45,26 @@ public function getRequirements() { } /** + * Get a toolkit operation plugin instance. + * + * @param string $operation + * The toolkit operation requested. + * + * @return \Drupal\Core\ImageToolkit\ImageToolkitOperationInterface + * An instance of the requested toolkit operation plugin. + */ + protected function getToolkitOperation($operation) { + return $this->operationManager->getToolkitOperation($this, $operation); + } + + /** * {@inheritdoc} */ public function apply($operation, ImageInterface $image, array $arguments = array()) { // Get the plugin to use for the operation. If there are no plugins // available, log an error message and return. try { - $plugin = $this->operationManager->getToolkitOperation($this, $operation); + $plugin = $this->getToolkitOperation($operation); } catch (PluginNotFoundException $e) { watchdog('image', 'The selected image handling toolkit %toolkit can not process operation %operation.', array('%toolkit' => $this->getPluginId(), '%operation' => $operation), WATCHDOG_ERROR);