File tree Expand file tree Collapse file tree 2 files changed +14
-5
lines changed Expand file tree Collapse file tree 2 files changed +14
-5
lines changed Original file line number Diff line number Diff line change @@ -150,21 +150,21 @@ public function __construct(&$settings) {
150
150
'chain ' => 'rtf->ps->pdf ' ,
151
151
),
152
152
),
153
- 'webp->jpg ' => array (
154
- 'webp->png->jpg ' => array (
153
+ 'webp->( jpg|gif|svg|tiff|wmf) ' => array (
154
+ 'webp->png->img ' => array (
155
155
'#engine ' => 'Chain ' ,
156
- 'chain ' => 'webp->png->jpg ' ,
156
+ 'chain ' => 'webp->png->* ' ,
157
157
),
158
158
),
159
159
'webp->png ' => array (
160
160
'webp:default ' => array (
161
161
'#engine ' => 'Convert \\WebP ' ,
162
162
),
163
163
),
164
- 'jpg->webp ' => array (
164
+ '( jpg|gif|svg|tiff|wmf) ->webp ' => array (
165
165
'jpg->png->webp ' => array (
166
166
'#engine ' => 'Chain ' ,
167
- 'chain ' => 'jpg ->png->webp ' ,
167
+ 'chain ' => '* ->png->webp ' ,
168
168
),
169
169
),
170
170
'png->webp ' => array (
Original file line number Diff line number Diff line change @@ -14,6 +14,15 @@ class Chain extends EngineBase {
14
14
public function convertFile ($ source , $ destination ) {
15
15
$ links = explode ('-> ' , $ this ->configuration ['chain ' ]);
16
16
17
+ // Allow wildcards for the start/end
18
+ if ($ links [0 ] === '* ' ) {
19
+ $ links [0 ] = $ this ->conversion [0 ];
20
+ }
21
+ if ($ links [sizeof ($ links ) - 1 ] === '* ' ) {
22
+ $ links [sizeof ($ links ) - 1 ] = $ this ->conversion [1 ];
23
+ }
24
+
25
+ // Iterate through the chain.
17
26
$ s_path = $ this ->getTempFile (array_shift ($ links ));
18
27
copy ($ source , $ s_path );
19
28
while (!empty ($ links )) {
You can’t perform that action at this time.
0 commit comments