diff --git a/imagemagick.module b/imagemagick.module index c42f3b4..c7ad0b8 100644 --- a/imagemagick.module +++ b/imagemagick.module @@ -372,6 +372,15 @@ function _imagemagick_convert($source, $dest, $args) { ); drupal_alter('imagemagick_arguments', $args, $context); + // If an argument ends with a colon ':', assume it is a the format the + // resulting image should be saved in. + foreach ($args as $operation) { + if (strrpos($operation, ':') == strlen($operation) - 1) { + $dest = $operation . $dest; + $args = array_diff($args, array($operation)); + } + } + // To make use of ImageMagick 6's parenthetical command grouping we need to make // the $source image the first parameter and $dest the last. // @see http://www.imagemagick.org/Usage/basics/#cmdline