-
Notifications
You must be signed in to change notification settings - Fork 226
Expand file tree
/
Copy pathOptimizerChainFactory.php
More file actions
40 lines (33 loc) · 950 Bytes
/
Copy pathOptimizerChainFactory.php
File metadata and controls
40 lines (33 loc) · 950 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php
namespace Spatie\ImageOptimizer;
use Spatie\ImageOptimizer\Optimizers\Svgo;
use Spatie\ImageOptimizer\Optimizers\Optipng;
use Spatie\ImageOptimizer\Optimizers\Gifsicle;
use Spatie\ImageOptimizer\Optimizers\Pngquant;
use Spatie\ImageOptimizer\Optimizers\Jpegoptim;
class OptimizerChainFactory
{
public static function create(): OptimizerChain
{
return (new OptimizerChain())
->addOptimizer(new Jpegoptim([
'--strip-all',
'--all-progressive',
]))
->addOptimizer(new Pngquant([
'--force',
]))
->addOptimizer(new Optipng([
'-i0',
'-o2',
'-quiet',
]))
->addOptimizer(new Svgo([
'--disable=cleanupIDs',
]))
->addOptimizer(new Gifsicle([
'-b',
'-O3',
]));
}
}