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\ImagemagickExecArguments $arguments
22 * The ImageMagick/GraphicsMagick execution arguments object.
24 * @see \Drupal\imagemagick\Plugin\ImageToolkit\ImagemagickToolkit::parseFile()
25 * @see \Drupal\imagemagick\ImagemagickExecArguments::getSource()
26 * @see \Drupal\imagemagick\ImagemagickExecArguments::setSourceLocalPath()
27 * @see \Drupal\imagemagick\ImagemagickExecArguments::getSourceLocalPath()
29 function hook_imagemagick_pre_parse_file_alter(\Drupal\imagemagick\ImagemagickExecArguments $arguments) {
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\ImagemagickExecArguments $arguments
40 * The ImageMagick/GraphicsMagick execution arguments object.
42 * @see \Drupal\imagemagick\Plugin\ImageToolkit\ImagemagickToolkit::save()
43 * @see \Drupal\imagemagick\ImagemagickExecArguments::getDestination()
44 * @see \Drupal\imagemagick\ImagemagickExecArguments::getDestinationLocalPath()
46 function hook_imagemagick_post_save_alter(\Drupal\imagemagick\ImagemagickExecArguments $arguments) {
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 * In addition to arguments that are passed to the binaries command line for
59 * execution, it is possible to push arguments to be used only by the toolkit
60 * or the hooks. You can add/get/find such arguments by specifying
61 * ImagemagickExecArguments::INTERNAL as the argument $mode in the methods.
63 * ImageMagick automatically converts the target image to the format denoted by
64 * the file extension. However, since changing the file extension is not always
65 * an option, you can specify an alternative image format via
66 * $arguments->setDestinationFormat('format'), where 'format' is a string
67 * denoting an Imagemagick supported format, or via
68 * $arguments->setDestinationFormatFromExtension('extension'), where
69 * 'extension' is a string denoting an image file extension.
71 * When the destination format is set, it is passed to ImageMagick's convert
72 * binary with the syntax "[format]:[destination]".
74 * @param \Drupal\imagemagick\ImagemagickExecArguments $arguments
75 * The ImageMagick/GraphicsMagick execution arguments object.
76 * @param string $command
77 * The ImageMagick/GraphicsMagick command being called.
79 * @see http://www.imagemagick.org/script/command-line-processing.php#output
80 * @see http://www.imagemagick.org/Usage/files/#save
82 * @see \Drupal\imagemagick\ImagemagickExecArguments
83 * @see \Drupal\imagemagick\Plugin\ImageToolkit\ImagemagickToolkit::convert()
84 * @see \Drupal\imagemagick\Plugin\FileMetadata\ImagemagickIdentify::identify()
86 function hook_imagemagick_arguments_alter(\Drupal\imagemagick\ImagemagickExecArguments $arguments, $command) {