summaryrefslogtreecommitdiff
path: root/it.class
diff options
context:
space:
mode:
authorChristian Schneider2009-10-23 21:37:42 +0000
committerChristian Schneider2009-10-23 21:37:42 +0000
commit1021938611e81caccb44d28029fa73a82680a7d4 (patch)
treeeb44780b76e2a2abd350e714dc52441f5c951d93 /it.class
parenta535a8a4e601e750de6d679046efe2a73dfc17c0 (diff)
downloaditools-1021938611e81caccb44d28029fa73a82680a7d4.tar.gz
itools-1021938611e81caccb44d28029fa73a82680a7d4.tar.bz2
itools-1021938611e81caccb44d28029fa73a82680a7d4.zip
Allow giving custom command line options to ImageMagick with it::imageconvert()
Diffstat (limited to 'it.class')
-rw-r--r--it.class4
1 files changed, 3 insertions, 1 deletions
diff --git a/it.class b/it.class
index fdc2fc0..f5a8978 100644
--- a/it.class
+++ b/it.class
@@ -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;
}