diff options
author | Christian Schneider | 2009-10-23 21:37:42 +0000 |
---|---|---|
committer | Christian Schneider | 2009-10-23 21:37:42 +0000 |
commit | 1021938611e81caccb44d28029fa73a82680a7d4 (patch) | |
tree | eb44780b76e2a2abd350e714dc52441f5c951d93 | |
parent | a535a8a4e601e750de6d679046efe2a73dfc17c0 (diff) | |
download | itools-1021938611e81caccb44d28029fa73a82680a7d4.tar.gz itools-1021938611e81caccb44d28029fa73a82680a7d4.tar.bz2 itools-1021938611e81caccb44d28029fa73a82680a7d4.zip |
Allow giving custom command line options to ImageMagick with it::imageconvert()
-rw-r--r-- | it.class | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -499,6 +499,7 @@ function _exec_quotevalue($value) * @param $p['size'] Width x height of resulting image, e.g. "160x60" * @param $p['type'] Output file type, e.g. "jpg" * @param $p['types'] Comma separated list of accepted input types, default "gif,jpg,png,bmp,tif,jp2,svg" + * @param $p['-opts'] Custom command line options to ImageMagick convert * @return Success of convert as true/false */ function imageconvert($p) @@ -519,9 +520,10 @@ function imageconvert($p) } $p += array('type' => $type, 'types' => "gif,jpg,png,bmp,tif,jp2,svg"); + $p['-opts'] = array('-thumbnail' => $p['size']) + (array)$p['-opts']; if (it::match(",$type,", ",{$p['types']},")) # Valid type? - $result = it::exec("convert 2>&1 -flatten -quality 75 {-opts} {in} {type}:{out}", array('-opts' => array('-thumbnail' => $p['size'])), $p) === ""; + $result = it::exec("convert 2>&1 -flatten -quality 75 {-opts} {in} {type}:{out}", $p) === ""; return $result; } |