support jpg format in curlycapt
authorChristian Weiske <cweiske@cweiske.de>
Tue, 8 Apr 2014 16:02:27 +0000 (18:02 +0200)
committerChristian Weiske <cweiske@cweiske.de>
Tue, 8 Apr 2014 16:02:27 +0000 (18:02 +0200)
src/phancap/Adapter/Cutycapt.php

index 173a86c78eaf2f0677188b85ccd2c4e683748122..909c90f03786643418ffe9350085ef54edc7bfdf 100644 (file)
@@ -10,10 +10,14 @@ class Adapter_Cutycapt
 
     public function render(Image $img, Options $options)
     {
+        $format = $options->values['sformat'];
+        if ($format == 'jpg') {
+            $format = 'jpeg';
+        }
         $tmpPath = $img->getPath() . '-tmp';
         $cmd = 'cutycapt'
             . ' --url=' . escapeshellarg($options->values['url'])
-            . ' --out-format=' . escapeshellarg($options->values['sformat'])
+            . ' --out-format=' . escapeshellarg($format)
             . ' --out=' . escapeshellarg($tmpPath)
             . ' --max-wait=10000'
             . ' --min-width=' . $options->values['bwidth'];