51478cba08a83be0a3f02b9e0527005fbb99fd92
[yaffs-website] / web / modules / contrib / imagemagick / imagemagick.api.php
1 <?php
2
3 /**
4  * @file
5  * API documentation for the ImageMagick module.
6  */
7
8 /**
9  * @addtogroup hooks
10  * @{
11  */
12
13 /**
14  * Alter the settings before an image is parsed by the ImageMagick toolkit.
15  *
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.
20  *
21  * @param \Drupal\imagemagick\ImagemagickExecArguments $arguments
22  *   The ImageMagick/GraphicsMagick execution arguments object.
23  *
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()
28  */
29 function hook_imagemagick_pre_parse_file_alter(\Drupal\imagemagick\ImagemagickExecArguments $arguments) {
30 }
31
32 /**
33  * Alter an image after it has been converted by the ImageMagick toolkit.
34  *
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
37  * systems.
38  *
39  * @param \Drupal\imagemagick\ImagemagickExecArguments $arguments
40  *   The ImageMagick/GraphicsMagick execution arguments object.
41  *
42  * @see \Drupal\imagemagick\Plugin\ImageToolkit\ImagemagickToolkit::save()
43  * @see \Drupal\imagemagick\ImagemagickExecArguments::getDestination()
44  * @see \Drupal\imagemagick\ImagemagickExecArguments::getDestinationLocalPath()
45  */
46 function hook_imagemagick_post_save_alter(\Drupal\imagemagick\ImagemagickExecArguments $arguments) {
47 }
48
49 /**
50  * Alter the arguments to ImageMagick command-line executables.
51  *
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.
57  *
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.
62  *
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.
70  *
71  * When the destination format is set, it is passed to ImageMagick's convert
72  * binary with the syntax "[format]:[destination]".
73  *
74  * @param \Drupal\imagemagick\ImagemagickExecArguments $arguments
75  *   The ImageMagick/GraphicsMagick execution arguments object.
76  * @param string $command
77  *   The ImageMagick/GraphicsMagick command being called.
78  *
79  * @see http://www.imagemagick.org/script/command-line-processing.php#output
80  * @see http://www.imagemagick.org/Usage/files/#save
81  *
82  * @see \Drupal\imagemagick\ImagemagickExecArguments
83  * @see \Drupal\imagemagick\Plugin\ImageToolkit\ImagemagickToolkit::convert()
84  * @see \Drupal\imagemagick\Plugin\FileMetadata\ImagemagickIdentify::identify()
85  */
86 function hook_imagemagick_arguments_alter(\Drupal\imagemagick\ImagemagickExecArguments $arguments, $command) {
87 }