@@ -29,6 +29,8 @@ protected function defaults(): array
29
29
'format ' => null ,
30
30
'hlglum ' => option ('fundevogel.colorist.hlglum ' , null ),
31
31
'jobs ' => option ('fundevogel.colorist.jobs ' , 0 ),
32
+ 'nclx ' => option ('fundevogel.colorist.nclx ' , null ),
33
+ 'rate ' => option ('fundevogel.colorist.rate ' , 0 ),
32
34
'speed ' => option ('fundevogel.colorist.speed ' , null ),
33
35
'tonemap ' => option ('fundevogel.colorist.tonemap ' , null ),
34
36
'yuv ' => option ('fundevogel.colorist.yuv ' , null ),
@@ -307,7 +309,11 @@ protected function hlglum(array $options): string
307
309
# See https://github.com/joedrago/colorist/blob/master/docs/Usage.md#-j---jobs
308
310
protected function jobs (array $ options ): string
309
311
{
310
- return '--jobs ' . $ options ['jobs ' ];
312
+ if ($ options ['jobs ' ] > 0 ) {
313
+ return '--jobs ' . $ options ['jobs ' ];
314
+ }
315
+
316
+ return '' ;
311
317
}
312
318
313
319
# (2) Output format options
@@ -350,6 +356,24 @@ protected function format(array $options): string
350
356
return '' ;
351
357
}
352
358
359
+ protected function nclx (array $ options ): string
360
+ {
361
+ if ($ options ['nclx ' ] !== null ) {
362
+ return '--nclx ' . $ options ['nclx ' ];
363
+ }
364
+
365
+ return '' ;
366
+ }
367
+
368
+ protected function rate (array $ options ): string
369
+ {
370
+ if ($ options ['rate ' ] > 0 ) {
371
+ return '--rate ' . $ options ['rate ' ];
372
+ }
373
+
374
+ return '' ;
375
+ }
376
+
353
377
protected function speed (array $ options ): string
354
378
{
355
379
if ($ options ['speed ' ] === null ) {
@@ -478,6 +502,8 @@ public function process(string $file, array $options = []): array
478
502
# (3) Output format options
479
503
$ command [] = $ this ->bpc ($ options );
480
504
$ command [] = $ this ->format ($ options );
505
+ $ command [] = $ this ->nclx ($ options );
506
+ $ command [] = $ this ->rate ($ options );
481
507
$ command [] = $ this ->speed ($ options );
482
508
$ command [] = $ this ->tonemap ($ options );
483
509
$ command [] = $ this ->yuv ($ options );
0 commit comments