Code Duplication    Length = 11-11 lines in 3 locations

src/CImage/CImage.php 3 locations

@@ 2336-2346 (lines=11) @@
2333
                imagejpeg($this->image, $this->cacheFileName, $this->quality);
2334
2335
                // Use JPEG optimize if defined
2336
                if ($this->jpegOptimizeCmd) {
2337
                    if ($this->verbose) {
2338
                        clearstatcache();
2339
                        $this->log("Filesize before optimize: " . filesize($this->cacheFileName) . " bytes.");
2340
                    }
2341
                    $res = array();
2342
                    $cmd = $this->jpegOptimizeCmd . " -outfile $this->cacheFileName $this->cacheFileName";
2343
                    exec($cmd, $res);
2344
                    $this->log($cmd);
2345
                    $this->log($res);
2346
                }
2347
                break;
2348
2349
            case 'gif':
@@ 2364-2374 (lines=11) @@
2361
                imagepng($this->image, $this->cacheFileName, $this->compress);
2362
2363
                // Use external program to filter PNG, if defined
2364
                if ($this->pngFilterCmd) {
2365
                    if ($this->verbose) {
2366
                        clearstatcache();
2367
                        $this->Log("Filesize before filter optimize: " . filesize($this->cacheFileName) . " bytes.");
2368
                    }
2369
                    $res = array();
2370
                    $cmd = $this->pngFilterCmd . " $this->cacheFileName";
2371
                    exec($cmd, $res);
2372
                    $this->Log($cmd);
2373
                    $this->Log($res);
2374
                }
2375
2376
                // Use external program to deflate PNG, if defined
2377
                if ($this->pngDeflateCmd) {
@@ 2377-2387 (lines=11) @@
2374
                }
2375
2376
                // Use external program to deflate PNG, if defined
2377
                if ($this->pngDeflateCmd) {
2378
                    if ($this->verbose) {
2379
                        clearstatcache();
2380
                        $this->Log("Filesize before deflate optimize: " . filesize($this->cacheFileName) . " bytes.");
2381
                    }
2382
                    $res = array();
2383
                    $cmd = $this->pngDeflateCmd . " $this->cacheFileName";
2384
                    exec($cmd, $res);
2385
                    $this->Log($cmd);
2386
                    $this->Log($res);
2387
                }
2388
                break;
2389
        }
2390