You are here

protected function ImagemagickImageToolkitOperationBase::addArgument in ImageMagick 8.2

Same name and namespace in other branches
  1. 8.3 src/Plugin/ImageToolkit/Operation/imagemagick/ImagemagickImageToolkitOperationBase.php \Drupal\imagemagick\Plugin\ImageToolkit\Operation\imagemagick\ImagemagickImageToolkitOperationBase::addArgument()

Helper to add a command line argument.

Adds the originating operation and plugin id to the $info array.

Parameters

string $argument: The command line argument to be added.

int $mode: (optional) The mode of the argument in the command line. Determines if the argument should be placed before or after the source image file path. Defaults to ImagemagickExecArguments::POST_SOURCE.

int $index: (optional) The position of the argument in the arguments array. Reflects the sequence of arguments in the command line. Defaults to ImagemagickExecArguments::APPEND.

array $info: (optional) An optional array with information about the argument. Defaults to an empty array.

Return value

\Drupal\imagemagick\ImagemagickExecArguments The Imagemagick arguments.

5 calls to ImagemagickImageToolkitOperationBase::addArgument()
CreateNew::execute in src/Plugin/ImageToolkit/Operation/imagemagick/CreateNew.php
Performs the actual manipulation on the image.
Crop::execute in src/Plugin/ImageToolkit/Operation/imagemagick/Crop.php
Performs the actual manipulation on the image.
Desaturate::execute in src/Plugin/ImageToolkit/Operation/imagemagick/Desaturate.php
Performs the actual manipulation on the image.
Resize::execute in src/Plugin/ImageToolkit/Operation/imagemagick/Resize.php
Performs the actual manipulation on the image.
Rotate::execute in src/Plugin/ImageToolkit/Operation/imagemagick/Rotate.php
Performs the actual manipulation on the image.

File

src/Plugin/ImageToolkit/Operation/imagemagick/ImagemagickImageToolkitOperationBase.php, line 47

Class

ImagemagickImageToolkitOperationBase
Base image toolkit operation class for Imagemagick.

Namespace

Drupal\imagemagick\Plugin\ImageToolkit\Operation\imagemagick

Code

protected function addArgument($argument, $mode = ImagemagickExecArguments::POST_SOURCE, $index = ImagemagickExecArguments::APPEND, array $info = []) {
  $plugin_definition = $this
    ->getPluginDefinition();
  $info = array_merge($info, [
    'image_toolkit_operation' => $plugin_definition['operation'],
    'image_toolkit_operation_plugin_id' => $plugin_definition['id'],
  ]);
  return $this
    ->getToolkit()
    ->arguments()
    ->add($argument, $mode, $index, $info);
}