File tree 1 file changed +10
-9
lines changed
1 file changed +10
-9
lines changed Original file line number Diff line number Diff line change 5
5
class ImageConverter
6
6
{
7
7
/** @var array */
8
- private $ imageFormat = [];
8
+ private $ imageFormat = [
9
+ 'gif ' ,
10
+ 'jpeg ' ,
11
+ 'jpg ' ,
12
+ 'png ' ,
13
+ 'webp ' ,
14
+ ];
9
15
10
16
/** @var array */
11
17
private $ constImageFormat = [
12
- IMAGETYPE_GIF => 'gif ' ,
18
+ IMAGETYPE_GIF => 'gif ' ,
13
19
IMAGETYPE_JPEG => 'jpeg ' ,
14
- IMAGETYPE_PNG => 'png ' ,
20
+ IMAGETYPE_PNG => 'png ' ,
15
21
IMAGETYPE_WEBP => 'webp ' ,
16
22
];
17
23
18
- public function __construct ()
19
- {
20
- $ this ->imageFormat = array_values ($ this ->constImageFormat );
21
- }
22
-
23
24
/**
24
25
* Do image conversion work
25
26
*
@@ -181,4 +182,4 @@ private function makeDirectory($to)
181
182
function convert ($ from , $ to , $ quality = null ) {
182
183
$ converter = new ImageConverter ();
183
184
return $ converter ->convert ($ from , $ to , $ quality );
184
- }
185
+ }
You can’t perform that action at this time.
0 commit comments