Make cutycapt options configurable
[phancap.git] / src / phancap / Adapter / Cutycapt.php
index a006a44574955ec4f3f6191b2e3e7097977a898c..13f972e22c8c3511d7a780f06cd131ae71acc536 100644 (file)
@@ -83,7 +83,16 @@ class Adapter_Cutycapt
         if ($format == 'jpg') {
             $format = 'jpeg';
         }
+
         $maxWaitTime = 30;//seconds
+        if (isset($this->config->cutycapt['maxWaitTime'])) {
+            $maxWaitTime = (int) $this->config->cutycapt['maxWaitTime'];
+        }
+
+        $parameters = '';
+        if (isset($this->config->cutycapt['parameters'])) {
+            $parameters = $this->config->cutycapt['parameters'];
+        }
 
         $serverNumber = $this->getServerNumber($options);
         $tmpPath = $img->getPath() . '-tmp';
@@ -96,6 +105,9 @@ class Adapter_Cutycapt
         if ($options->values['bheight'] !== null) {
             $cmd .= ' --min-height=' . $options->values['bheight'];
         }
+        if (strlen($parameters) > 0) {
+            $cmd .= ' ' . $parameters;
+        }
 
         $xvfbcmd = 'xvfb-run'
             . ' -e /dev/stdout'