support jpg format in curlycapt
[phancap.git] / 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'];