You are here

protected function Scale::arguments in ImageMagick 8

Same name and namespace in other branches
  1. 8.3 src/Plugin/ImageToolkit/Operation/imagemagick/Scale.php \Drupal\imagemagick\Plugin\ImageToolkit\Operation\imagemagick\Scale::arguments()
  2. 8.2 src/Plugin/ImageToolkit/Operation/imagemagick/Scale.php \Drupal\imagemagick\Plugin\ImageToolkit\Operation\imagemagick\Scale::arguments()

Returns the definition of the operation arguments.

Image toolkit operation implementers must implement this method to "document" their operation, thus also if no arguments are expected.

Return value

array An array whose keys are the names of the arguments (e.g. "width", "degrees") and each value is an associative array having the following keys:

  • description: A string with the argument description. This is used only internally for documentation purposes, so it does not need to be translatable.
  • required: (optional) A boolean indicating if this argument should be provided or not. Defaults to TRUE.
  • default: (optional) When the argument is set to "required" = FALSE, this must be set to a default value. Ignored for "required" = TRUE arguments.

Overrides Resize::arguments

File

src/Plugin/ImageToolkit/Operation/imagemagick/Scale.php, line 21

Class

Scale
Defines imagemagick Scale operation.

Namespace

Drupal\imagemagick\Plugin\ImageToolkit\Operation\imagemagick

Code

protected function arguments() {
  return [
    'width' => [
      'description' => 'The target width, in pixels. This value is omitted then the scaling will based only on the height value',
      'required' => FALSE,
      'default' => NULL,
    ],
    'height' => [
      'description' => 'The target height, in pixels. This value is omitted then the scaling will based only on the width value',
      'required' => FALSE,
      'default' => NULL,
    ],
    'upscale' => [
      'description' => 'Boolean indicating that files smaller than the dimensions will be scaled up. This generally results in a low quality image',
      'required' => FALSE,
      'default' => FALSE,
    ],
    'filter' => [
      'description' => 'An optional filter to apply for the resize',
      'required' => FALSE,
      'default' => '',
    ],
  ];
}