1 | <?php |
||
10 | class Image |
||
11 | { |
||
12 | /** @var string */ |
||
13 | protected $pathToImage; |
||
14 | |||
15 | /** @var \Spatie\Image\Manipulations */ |
||
16 | protected $manipulations; |
||
17 | |||
18 | protected $imageDriver = 'gd'; |
||
19 | |||
20 | protected $shouldOptimize = false; |
||
21 | protected $optimizationOptions = []; |
||
22 | |||
23 | /** |
||
24 | * @param string $pathToImage |
||
25 | * |
||
26 | * @return static |
||
27 | */ |
||
28 | public static function load(string $pathToImage) |
||
32 | |||
33 | public function __construct(string $pathToImage) |
||
39 | |||
40 | /** |
||
41 | * @param string $imageDriver |
||
42 | * |
||
43 | * @return $this |
||
44 | * |
||
45 | * @throws InvalidImageDriver |
||
46 | */ |
||
47 | public function useImageDriver(string $imageDriver) |
||
57 | |||
58 | /** |
||
59 | * @param callable|$manipulations |
||
60 | * |
||
61 | * @return $this |
||
62 | */ |
||
63 | public function manipulate($manipulations) |
||
75 | |||
76 | public function __call($name, $arguments) |
||
86 | |||
87 | public function getManipulationSequence(): ManipulationSequence |
||
91 | |||
92 | /** |
||
93 | * @param array $optimizationOptions |
||
94 | * |
||
95 | * @return $this |
||
96 | */ |
||
97 | public function optimize($optimizationOptions = []) |
||
105 | |||
106 | public function save($outputPath = '') |
||
123 | |||
124 | protected function performOptimization($path) |
||
132 | |||
133 | protected function addFormatManipulation($outputPath) |
||
152 | } |
||
153 |