5 * API documentation for the ImageMagick module.
14 * Alter the settings before an image is parsed by the ImageMagick toolkit.
16 * ImageMagick does not support stream wrappers so this hook allows modules to
17 * resolve URIs of image files to paths on the local filesystem.
18 * Modules can also decide to move files from remote systems to the local
19 * file system to allow processing.
21 * @param \Drupal\imagemagick\Plugin\ImageToolkit\ImagemagickToolkit $toolkit
22 * The Imagemagick toolkit instance to alter.
24 * @see \Drupal\imagemagick\Plugin\ImageToolkit\ImagemagickToolkit::parseFile()
25 * @see \Drupal\imagemagick\Plugin\ImageToolkit\ImagemagickToolkit::getSource()
26 * @see \Drupal\imagemagick\Plugin\ImageToolkit\ImagemagickToolkit::setSourceLocalPath()
27 * @see \Drupal\imagemagick\Plugin\ImageToolkit\ImagemagickToolkit::getSourceLocalPath()
29 function hook_imagemagick_pre_parse_file_alter(\Drupal\imagemagick\Plugin\ImageToolkit\ImagemagickToolkit $toolkit) {
33 * Alter an image after it has been converted by the ImageMagick toolkit.
35 * ImageMagick does not support remote file systems, so modules can decide
36 * to move temporary files from the local file system to remote destination
39 * @param \Drupal\imagemagick\Plugin\ImageToolkit\ImagemagickToolkit $toolkit
40 * The Imagemagick toolkit instance to alter.
42 * @see \Drupal\imagemagick\Plugin\ImageToolkit\ImagemagickToolkit::getDestination()
43 * @see \Drupal\imagemagick\Plugin\ImageToolkit\ImagemagickToolkit::getDestinationLocalPath()
44 * @see \Drupal\imagemagick\Plugin\ImageToolkit\ImagemagickToolkit::save()
46 function hook_imagemagick_post_save_alter(\Drupal\imagemagick\Plugin\ImageToolkit\ImagemagickToolkit $toolkit) {
50 * Alter the arguments to ImageMagick command-line executables.
52 * This hook is executed just before Imagemagick executables are called.
53 * It allows to change file paths for source and destination image files,
54 * and/or to alter the command line arguments that are passed to the binaries.
55 * The toolkit provides methods to prepend, add, find, get and reset
56 * arguments that have already been set by image effects.
58 * ImageMagick automatically converts the target image to the format denoted by
59 * the file extension. However, since changing the file extension is not always
60 * an option, you can specify an alternative image format via
61 * $toolkit->setDestinationFormat('format'), where 'format' is a string
62 * denoting an Imagemagick supported format.
63 * When the destination format is set, it is passed to ImageMagick's convert
64 * binary with the syntax "[format]:[destination]".
66 * @param \Drupal\imagemagick\Plugin\ImageToolkit\ImagemagickToolkit $toolkit
67 * The Imagemagick toolkit instance to alter.
68 * @param string $command
69 * The Imagemagick binary being called.
71 * @see http://www.imagemagick.org/script/command-line-processing.php#output
72 * @see http://www.imagemagick.org/Usage/files/#save
74 * @see \Drupal\imagemagick\Plugin\ImageToolkit\ImagemagickToolkit::getArguments()
75 * @see \Drupal\imagemagick\Plugin\ImageToolkit\ImagemagickToolkit::prependArgument()
76 * @see \Drupal\imagemagick\Plugin\ImageToolkit\ImagemagickToolkit::addArgument()
77 * @see \Drupal\imagemagick\Plugin\ImageToolkit\ImagemagickToolkit::findArgument()
78 * @see \Drupal\imagemagick\Plugin\ImageToolkit\ImagemagickToolkit::resetArguments()
79 * @see \Drupal\imagemagick\Plugin\ImageToolkit\ImagemagickToolkit::getSource()
80 * @see \Drupal\imagemagick\Plugin\ImageToolkit\ImagemagickToolkit::setSourceLocalPath()
81 * @see \Drupal\imagemagick\Plugin\ImageToolkit\ImagemagickToolkit::getSourceLocalPath()
82 * @see \Drupal\imagemagick\Plugin\ImageToolkit\ImagemagickToolkit::getDestination()
83 * @see \Drupal\imagemagick\Plugin\ImageToolkit\ImagemagickToolkit::setDestinationLocalPath()
84 * @see \Drupal\imagemagick\Plugin\ImageToolkit\ImagemagickToolkit::getDestinationLocalPath()
85 * @see \Drupal\imagemagick\Plugin\ImageToolkit\ImagemagickToolkit::convert()
86 * @see \Drupal\imagemagick\Plugin\ImageToolkit\ImagemagickToolkit::identify()
88 function hook_imagemagick_arguments_alter(\Drupal\imagemagick\Plugin\ImageToolkit\ImagemagickToolkit $toolkit, $command) {