function hook_imagemagick_arguments_alter in ImageMagick 8
Same name and namespace in other branches
- 8.2 imagemagick.api.php \hook_imagemagick_arguments_alter()
- 7 imagemagick.api.php \hook_imagemagick_arguments_alter()
Alter the arguments to ImageMagick command-line executables.
This hook is executed just before Imagemagick executables are called. It allows to change file paths for source and destination image files, and/or to alter the command line arguments that are passed to the binaries. The toolkit provides methods to prepend, add, find, get and reset arguments that have already been set by image effects.
ImageMagick automatically converts the target image to the format denoted by the file extension. However, since changing the file extension is not always an option, you can specify an alternative image format via $toolkit->setDestinationFormat('format'), where 'format' is a string denoting an Imagemagick supported format. When the destination format is set, it is passed to ImageMagick's convert binary with the syntax "[format]:[destination]".
Parameters
\Drupal\imagemagick\Plugin\ImageToolkit\ImagemagickToolkit $toolkit: The Imagemagick toolkit instance to alter.
string $command: The Imagemagick binary being called.
See also
http://www.imagemagick.org/script/command-line-processing.php#output
http://www.imagemagick.org/Usage/files/#save
\Drupal\imagemagick\Plugin\ImageToolkit\ImagemagickToolkit::getArguments()
\Drupal\imagemagick\Plugin\ImageToolkit\ImagemagickToolkit::prependArgument()
\Drupal\imagemagick\Plugin\ImageToolkit\ImagemagickToolkit::addArgument()
\Drupal\imagemagick\Plugin\ImageToolkit\ImagemagickToolkit::findArgument()
\Drupal\imagemagick\Plugin\ImageToolkit\ImagemagickToolkit::resetArguments()
\Drupal\imagemagick\Plugin\ImageToolkit\ImagemagickToolkit::getSource()
\Drupal\imagemagick\Plugin\ImageToolkit\ImagemagickToolkit::setSourceLocalPath()
\Drupal\imagemagick\Plugin\ImageToolkit\ImagemagickToolkit::getSourceLocalPath()
\Drupal\imagemagick\Plugin\ImageToolkit\ImagemagickToolkit::getDestination()
\Drupal\imagemagick\Plugin\ImageToolkit\ImagemagickToolkit::setDestinationLocalPath()
\Drupal\imagemagick\Plugin\ImageToolkit\ImagemagickToolkit::getDestinationLocalPath()
\Drupal\imagemagick\Plugin\ImageToolkit\ImagemagickToolkit::convert()
\Drupal\imagemagick\Plugin\ImageToolkit\ImagemagickToolkit::identify()
1 function implements hook_imagemagick_arguments_alter()
Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.
2 invocations of hook_imagemagick_arguments_alter()
- ImagemagickToolkit::convert in src/
Plugin/ ImageToolkit/ ImagemagickToolkit.php - Calls the convert executable with the specified arguments.
- ImagemagickToolkit::identify in src/
Plugin/ ImageToolkit/ ImagemagickToolkit.php - Calls the identify executable on the specified file.
File
- ./
imagemagick.api.php, line 88 - API documentation for the ImageMagick module.
Code
function hook_imagemagick_arguments_alter(\Drupal\imagemagick\Plugin\ImageToolkit\ImagemagickToolkit $toolkit, $command) {
}