You are here

public function ImagemagickExecArguments::toString in ImageMagick 8.2

Same name and namespace in other branches
  1. 8.3 src/ImagemagickExecArguments.php \Drupal\imagemagick\ImagemagickExecArguments::toString()

Gets a portion of the command line arguments string.

Parameters

int $mode: The mode of the string on the command line. Can be self::PRE_SOURCE or self::POST_SOURCE.

Return value

string The sring of command line arguments.

1 call to ImagemagickExecArguments::toString()
ImagemagickExecArguments::getStringForBinary in src/ImagemagickExecArguments.php
Gets the command line arguments string for the binary.

File

src/ImagemagickExecArguments.php, line 164

Class

ImagemagickExecArguments
Stores arguments for execution of ImageMagick/GraphicsMagick commands.

Namespace

Drupal\imagemagick

Code

public function toString($mode) {
  if (!$this->arguments) {
    return '';
  }
  $ret = [];
  foreach ($this->arguments as $a) {
    if ($a['mode'] === $mode) {
      $ret[] = $a['argument'];
    }
  }
  return implode(' ', $ret);
}