@depup/sharp-cli 5.2.0-depup.0 → 6.0.0-depup.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/.github/workflows/ci.yml +30 -0
  2. package/.prettierignore +2 -0
  3. package/.prettierrc +1 -0
  4. package/CHANGELOG.md +40 -8
  5. package/README.md +6 -9
  6. package/bin/cli.js +5 -5
  7. package/changes.json +5 -17
  8. package/cmd/channel-manipulation/bandbool.js +24 -19
  9. package/cmd/channel-manipulation/ensure-alpha.js +27 -22
  10. package/cmd/channel-manipulation/extract-channel.js +23 -19
  11. package/cmd/channel-manipulation/join-channel.js +19 -20
  12. package/cmd/channel-manipulation/remove-alpha.js +12 -15
  13. package/cmd/colour-manipulation/greyscale.js +16 -16
  14. package/cmd/colour-manipulation/pipeline-colourspace.js +26 -22
  15. package/cmd/colour-manipulation/tint.js +17 -19
  16. package/cmd/colour-manipulation/tocolourspace.js +22 -21
  17. package/cmd/compositing/composite.js +133 -102
  18. package/cmd/operations/affine.js +57 -51
  19. package/cmd/operations/blur.js +44 -41
  20. package/cmd/operations/boolean.js +22 -21
  21. package/cmd/operations/clahe.js +37 -37
  22. package/cmd/operations/convolve.js +52 -48
  23. package/cmd/operations/dilate.js +58 -0
  24. package/cmd/operations/erode.js +58 -0
  25. package/cmd/operations/flatten.js +23 -24
  26. package/cmd/operations/flip.js +12 -15
  27. package/cmd/operations/flop.js +12 -15
  28. package/cmd/operations/gamma.js +26 -25
  29. package/cmd/operations/linear.js +30 -29
  30. package/cmd/operations/median.js +18 -22
  31. package/cmd/operations/modulate.js +42 -31
  32. package/cmd/operations/negate.js +17 -20
  33. package/cmd/operations/normalise.js +28 -25
  34. package/cmd/operations/recomb.js +34 -32
  35. package/cmd/operations/rotate.js +31 -29
  36. package/cmd/operations/sharpen.js +49 -45
  37. package/cmd/operations/threshold.js +29 -29
  38. package/cmd/operations/unflatten.js +14 -16
  39. package/cmd/output.js +61 -56
  40. package/cmd/resizing/extend.js +55 -49
  41. package/cmd/resizing/extract.js +32 -33
  42. package/cmd/resizing/resize.js +79 -56
  43. package/cmd/resizing/trim.js +59 -36
  44. package/{lib/queue.js → eslint.config.mjs} +21 -17
  45. package/lib/cli.js +637 -383
  46. package/lib/constants.js +24 -18
  47. package/lib/convert.js +106 -73
  48. package/lib/index.js +56 -23
  49. package/lib/utils.js +50 -0
  50. package/package.json +27 -37
@@ -23,44 +23,45 @@
23
23
 
24
24
  // @see https://sharp.pixelplumbing.com/api-operation#boolean
25
25
 
26
- // Strict mode.
27
- 'use strict'
28
-
29
26
  // Local modules.
30
- const constants = require('../../lib/constants')
31
- const queue = require('../../lib/queue')
27
+ import constants from "../../lib/constants.js";
32
28
 
33
29
  // Configure.
34
30
  const positionals = {
35
31
  operand: {
36
- desc: 'Path to an image file',
32
+ desc: "Path to an image file",
37
33
  normalize: true,
38
- type: 'string'
34
+ type: "string",
39
35
  },
40
36
  operator: {
41
37
  choices: constants.BOOL,
42
- desc: 'Operator to perform that bitwise operation'
43
- }
44
- }
38
+ desc: "Operator to perform that bitwise operation",
39
+ },
40
+ };
45
41
 
46
42
  // Command builder.
47
43
  const builder = (yargs) => {
48
44
  return yargs
49
45
  .strict()
50
- .epilog('For more information on available options, please visit https://sharp.pixelplumbing.com/api-operation#boolean')
51
- .positional('operand', positionals.operand)
52
- .positional('operator', positionals.operator)
53
- }
46
+ .epilog(
47
+ "For more information on available options, please visit https://sharp.pixelplumbing.com/api-operation#boolean",
48
+ )
49
+ .positional("operand", positionals.operand)
50
+ .positional("operator", positionals.operator);
51
+ };
54
52
 
55
53
  // Command handler.
56
54
  const handler = (args) => {
57
- return queue.push(['boolean', (sharp) => sharp.boolean(args.operand, args.operator)])
58
- }
55
+ return args["#queue"].push([
56
+ "boolean",
57
+ (sharp) => sharp.boolean(args.operand, args.operator),
58
+ ]);
59
+ };
59
60
 
60
61
  // Exports.
61
- module.exports = {
62
- command: 'boolean <operand> <operator>',
63
- describe: 'Perform a bitwise boolean operation with operand image',
62
+ export default {
63
+ command: "boolean <operand> <operator>",
64
+ describe: "Perform a bitwise boolean operation with operand image",
64
65
  builder,
65
- handler
66
- }
66
+ handler,
67
+ };
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * The MIT License (MIT)
3
3
  *
4
- * Copyright (c) 2022 Mark van Seventer
4
+ * Copyright (c) 2019 Mark van Seventer
5
5
  *
6
6
  * Permission is hereby granted, free of charge, to any person obtaining a copy of
7
7
  * this software and associated documentation files (the "Software"), to deal in
@@ -23,60 +23,60 @@
23
23
 
24
24
  // @see https://sharp.pixelplumbing.com/api-operation#clahe
25
25
 
26
- // Strict mode.
27
- 'use strict'
28
-
29
- // Local modules.
30
- const queue = require('../../lib/queue')
31
-
32
26
  // Configure.
33
27
  const positionals = {
34
28
  height: {
35
- desc: 'Height of the region',
36
- type: 'number'
29
+ desc: "Height of the region",
30
+ type: "number",
37
31
  },
38
32
  width: {
39
- desc: 'Width of the region',
40
- type: 'number'
41
- }
42
- }
33
+ desc: "Width of the region",
34
+ type: "number",
35
+ },
36
+ };
43
37
 
44
38
  const options = {
45
39
  maxSlope: {
46
40
  defaultDescription: 3,
47
- desc: 'Maximum value for the slope of the cumulative histogram',
48
- type: 'number'
49
- }
50
- }
41
+ desc: "Maximum value for the slope of the cumulative histogram",
42
+ nargs: 1,
43
+ type: "number",
44
+ },
45
+ };
51
46
 
52
47
  // Command builder.
53
48
  const builder = (yargs) => {
54
- const optionNames = Object.keys(options)
49
+ const optionNames = Object.keys(options);
55
50
  return yargs
56
51
  .strict()
57
- .example('$0 clahe 3 3')
58
- .epilog('For more information on available options, please visit https://sharp.pixelplumbing.com/api-operation#clahe')
59
- .positional('height', positionals.height)
60
- .positional('width', positionals.width)
52
+ .example("$0 clahe 3 3")
53
+ .epilog(
54
+ "For more information on available options, please visit https://sharp.pixelplumbing.com/api-operation#clahe",
55
+ )
56
+ .positional("height", positionals.height)
57
+ .positional("width", positionals.width)
61
58
  .options(options)
62
- .group(optionNames, 'Command Options')
63
- }
59
+ .group(optionNames, "Command Options");
60
+ };
64
61
 
65
62
  // Command handler.
66
63
  const handler = (args) => {
67
- return queue.push(['clahe', (sharp) => {
68
- return sharp.clahe({
69
- width: args.width,
70
- height: args.height,
71
- maxSlope: args.maxSlope
72
- })
73
- }])
74
- }
64
+ return args["#queue"].push([
65
+ "clahe",
66
+ (sharp) => {
67
+ return sharp.clahe({
68
+ width: args.width,
69
+ height: args.height,
70
+ maxSlope: args.maxSlope,
71
+ });
72
+ },
73
+ ]);
74
+ };
75
75
 
76
76
  // Exports.
77
- module.exports = {
78
- command: 'clahe <width> <height>',
79
- describe: 'Perform contrast limiting adaptive histogram equalization CLAHE',
77
+ export default {
78
+ command: "clahe <width> <height>",
79
+ describe: "Perform contrast limiting adaptive histogram equalization CLAHE",
80
80
  builder,
81
- handler
82
- }
81
+ handler,
82
+ };
@@ -23,81 +23,85 @@
23
23
 
24
24
  // @see https://sharp.pixelplumbing.com/api-operation#convolve
25
25
 
26
- // Strict mode.
27
- 'use strict'
28
-
29
- // Package modules.
30
- const pick = require('lodash.pick')
31
-
32
26
  // Local modules.
33
- const queue = require('../../lib/queue')
27
+ import { pick } from "../../lib/utils.js";
34
28
 
35
29
  // Configure.
36
30
  const positionals = {
37
31
  height: {
38
- desc: 'Height of the kernel in pixels',
39
- type: 'number'
32
+ desc: "Height of the kernel in pixels",
33
+ type: "number",
40
34
  },
41
35
  kernel: {
42
- desc: 'Array of length width × height containing the kernel values',
36
+ desc: "Array of length width × height containing the kernel values",
43
37
  defaultDescription: '"-1 0 1 -2 0 2 -1 0 1"',
44
- type: 'number'
38
+ type: "number",
45
39
  },
46
40
  width: {
47
- desc: 'Width of the kernel in pixels',
48
- type: 'number'
49
- }
50
- }
51
- const positionalNames = Object.keys(positionals)
41
+ desc: "Width of the kernel in pixels",
42
+ type: "number",
43
+ },
44
+ };
45
+ const positionalNames = Object.keys(positionals);
52
46
 
53
47
  const options = {
54
48
  scale: {
55
- desc: 'The scale of the kernel in pixels',
56
- defaultDescription: 'sum',
57
- type: 'number'
49
+ desc: "The scale of the kernel in pixels",
50
+ defaultDescription: "sum",
51
+ nargs: 1,
52
+ type: "number",
58
53
  },
59
54
  offset: {
60
- desc: 'The offset of the kernel in pixels',
61
- defaultDescription: '0',
62
- type: 'number'
63
- }
64
- }
65
- const optionNames = Object.keys(options)
55
+ desc: "The offset of the kernel in pixels",
56
+ defaultDescription: "0",
57
+ nargs: 1,
58
+ type: "number",
59
+ },
60
+ };
61
+ const optionNames = Object.keys(options);
66
62
 
67
63
  // Command builder.
68
64
  const builder = (yargs) => {
69
65
  return yargs
70
66
  .strict()
71
- .example('$0 convolve 3 3 "-1 0 1 -2 0 2 -1 0 1"', 'The output will be the convolution of the input image with the horizontal Sobel operator')
72
- .epilog('For more information on available options, please visit https://sharp.pixelplumbing.com/api-operation#convolve')
73
- .check(argv => {
74
- const length = argv.width * argv.height
67
+ .example(
68
+ '$0 convolve 3 3 "-1 0 1 -2 0 2 -1 0 1"',
69
+ "The output will be the convolution of the input image with the horizontal Sobel operator",
70
+ )
71
+ .epilog(
72
+ "For more information on available options, please visit https://sharp.pixelplumbing.com/api-operation#convolve",
73
+ )
74
+ .check((argv) => {
75
+ const length = argv.width * argv.height;
75
76
  if (!(Array.isArray(argv.kernel) && argv.kernel.length === length)) {
76
- throw new Error(`Expected kernel positional to have ${length} values`)
77
+ throw new Error(`Expected kernel positional to have ${length} values`);
77
78
  }
78
- return true
79
+ return true;
79
80
  })
80
81
  .options(options)
81
- .positional('kernel', positionals.kernel)
82
- .positional('height', positionals.height)
83
- .positional('width', positionals.width)
84
- .group(optionNames, 'Command Options')
85
- }
82
+ .positional("kernel", positionals.kernel)
83
+ .positional("height", positionals.height)
84
+ .positional("width", positionals.width)
85
+ .group(optionNames, "Command Options");
86
+ };
86
87
 
87
88
  // Command handler.
88
89
  const handler = (args) => {
89
- return queue.push(['convolve', (sharp) => {
90
- return sharp.convolve({
91
- ...pick(args, positionalNames),
92
- ...pick(args, optionNames)
93
- })
94
- }])
95
- }
90
+ return args["#queue"].push([
91
+ "convolve",
92
+ (sharp) => {
93
+ return sharp.convolve({
94
+ ...pick(args, positionalNames),
95
+ ...pick(args, optionNames),
96
+ });
97
+ },
98
+ ]);
99
+ };
96
100
 
97
101
  // Exports.
98
- module.exports = {
99
- command: 'convolve <width> <height> <kernel..>',
100
- describe: 'Convolve the image with the specified kernel',
102
+ export default {
103
+ command: "convolve <width> <height> <kernel..>",
104
+ describe: "Convolve the image with the specified kernel",
101
105
  builder,
102
- handler
103
- }
106
+ handler,
107
+ };
@@ -0,0 +1,58 @@
1
+ /*!
2
+ * The MIT License (MIT)
3
+ *
4
+ * Copyright (c) 2019 Mark van Seventer
5
+ *
6
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
7
+ * this software and associated documentation files (the "Software"), to deal in
8
+ * the Software without restriction, including without limitation the rights to
9
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
10
+ * the Software, and to permit persons to whom the Software is furnished to do so,
11
+ * subject to the following conditions:
12
+ *
13
+ * The above copyright notice and this permission notice shall be included in all
14
+ * copies or substantial portions of the Software.
15
+ *
16
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
18
+ * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
19
+ * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
20
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
+ */
23
+
24
+ // @see https://sharp.pixelplumbing.com/api-operation#dilate
25
+
26
+ // Configure.
27
+ const positionals = {
28
+ width: {
29
+ desc: "Dilation width in pixels",
30
+ defaultDescription: 1,
31
+ type: "number",
32
+ },
33
+ };
34
+
35
+ // Command builder.
36
+ const builder = (yargs) => {
37
+ return yargs
38
+ .strict()
39
+ .example("$0 dilate")
40
+ .example("$0 dilate 3")
41
+ .epilog(
42
+ "For more information on available options, please visit https://sharp.pixelplumbing.com/api-operation#dilate",
43
+ )
44
+ .positional("width", positionals.width);
45
+ };
46
+
47
+ // Command handler.
48
+ const handler = (args) => {
49
+ return args["#queue"].push(["dilate", (sharp) => sharp.dilate(args.width)]);
50
+ };
51
+
52
+ // Exports.
53
+ export default {
54
+ command: "dilate [width]",
55
+ describe: "Expand foreground objects using the dilate morphological operator",
56
+ builder,
57
+ handler,
58
+ };
@@ -0,0 +1,58 @@
1
+ /*!
2
+ * The MIT License (MIT)
3
+ *
4
+ * Copyright (c) 2019 Mark van Seventer
5
+ *
6
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
7
+ * this software and associated documentation files (the "Software"), to deal in
8
+ * the Software without restriction, including without limitation the rights to
9
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
10
+ * the Software, and to permit persons to whom the Software is furnished to do so,
11
+ * subject to the following conditions:
12
+ *
13
+ * The above copyright notice and this permission notice shall be included in all
14
+ * copies or substantial portions of the Software.
15
+ *
16
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
18
+ * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
19
+ * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
20
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
+ */
23
+
24
+ // @see https://sharp.pixelplumbing.com/api-operation#erode
25
+
26
+ // Configure.
27
+ const positionals = {
28
+ width: {
29
+ desc: "Erosion width in pixels",
30
+ defaultDescription: 1,
31
+ type: "number",
32
+ },
33
+ };
34
+
35
+ // Command builder.
36
+ const builder = (yargs) => {
37
+ return yargs
38
+ .strict()
39
+ .example("$0 erode")
40
+ .example("$0 erode 3")
41
+ .epilog(
42
+ "For more information on available options, please visit https://sharp.pixelplumbing.com/api-operation#erode",
43
+ )
44
+ .positional("width", positionals.width);
45
+ };
46
+
47
+ // Command handler.
48
+ const handler = (args) => {
49
+ return args["#queue"].push(["erode", (sharp) => sharp.erode(args.width)]);
50
+ };
51
+
52
+ // Exports.
53
+ export default {
54
+ command: "erode [width]",
55
+ describe: "Shrink foreground objects using the erode morphological operator",
56
+ builder,
57
+ handler,
58
+ };
@@ -21,43 +21,42 @@
21
21
  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
22
  */
23
23
 
24
- // @see https://sharp.dimens.io/api-operation#flatten
25
-
26
- // Strict mode.
27
- 'use strict'
28
-
29
- // Local modules.
30
- const queue = require('../../lib/queue')
24
+ // @see https://sharp.pixelplumbing.com/api-operation#flatten
31
25
 
32
26
  // Configure.
33
27
  const positionals = {
34
28
  background: {
35
- defaultDescription: 'rgb(0, 0, 0)',
36
- desc: 'Background colour, parsed by the color module',
37
- type: 'string'
38
- }
39
- }
29
+ defaultDescription: "rgb(0, 0, 0)",
30
+ desc: "Background colour, parsed by the color module",
31
+ type: "string",
32
+ },
33
+ };
40
34
 
41
35
  // Command builder.
42
36
  const builder = (yargs) => {
43
37
  return yargs
44
38
  .strict()
45
39
  .example('$0 flatten "#F0A703"')
46
- .epilog('For more information on available options, please visit https://sharp.dimens.io/api-operation#flatten')
47
- .positional('background', positionals.background)
48
- }
40
+ .epilog(
41
+ "For more information on available options, please visit https://sharp.pixelplumbing.com/api-operation#flatten",
42
+ )
43
+ .positional("background", positionals.background);
44
+ };
49
45
 
50
46
  // Command handler.
51
47
  const handler = (args) => {
52
- return queue.push(['flatten', (sharp) => {
53
- return sharp.flatten({ background: args.background })
54
- }])
55
- }
48
+ return args["#queue"].push([
49
+ "flatten",
50
+ (sharp) => {
51
+ return sharp.flatten({ background: args.background });
52
+ },
53
+ ]);
54
+ };
56
55
 
57
56
  // Exports.
58
- module.exports = {
59
- command: 'flatten [background]',
60
- describe: 'Merge alpha transparency channel, if any, with a background',
57
+ export default {
58
+ command: "flatten [background]",
59
+ describe: "Merge alpha transparency channel, if any, with a background",
61
60
  builder,
62
- handler
63
- }
61
+ handler,
62
+ };
@@ -23,27 +23,24 @@
23
23
 
24
24
  // @see https://sharp.pixelplumbing.com/api-operation#flip
25
25
 
26
- // Strict mode.
27
- 'use strict'
28
-
29
- // Local modules.
30
- const queue = require('../../lib/queue')
31
-
32
26
  // Command builder.
33
27
  const builder = (yargs) => {
34
28
  return yargs
35
29
  .strict()
36
- .epilog('For more information on available options, please visit https://sharp.pixelplumbing.com/api-operation#flip')
37
- .example('$0 flip')
38
- }
30
+ .epilog(
31
+ "For more information on available options, please visit https://sharp.pixelplumbing.com/api-operation#flip",
32
+ )
33
+ .example("$0 flip");
34
+ };
39
35
 
40
36
  // Command handler.
41
- const handler = (args) => queue.push(['flip', (sharp) => sharp.flip()])
37
+ const handler = (args) =>
38
+ args["#queue"].push(["flip", (sharp) => sharp.flip()]);
42
39
 
43
40
  // Exports.
44
- module.exports = {
45
- command: 'flip',
46
- describe: 'Flip the image about the vertical Y axis',
41
+ export default {
42
+ command: "flip",
43
+ describe: "Flip the image about the vertical Y axis",
47
44
  builder,
48
- handler
49
- }
45
+ handler,
46
+ };
@@ -23,27 +23,24 @@
23
23
 
24
24
  // @see https://sharp.pixelplumbing.com/api-operation#flop
25
25
 
26
- // Strict mode.
27
- 'use strict'
28
-
29
- // Local modules.
30
- const queue = require('../../lib/queue')
31
-
32
26
  // Command builder.
33
27
  const builder = (yargs) => {
34
28
  return yargs
35
29
  .strict()
36
- .epilog('For more information on available options, please visit https://sharp.pixelplumbing.com/api-operation#flop')
37
- .example('$0 flop')
38
- }
30
+ .epilog(
31
+ "For more information on available options, please visit https://sharp.pixelplumbing.com/api-operation#flop",
32
+ )
33
+ .example("$0 flop");
34
+ };
39
35
 
40
36
  // Command handler.
41
- const handler = (args) => queue.push(['flop', (sharp) => sharp.flop()])
37
+ const handler = (args) =>
38
+ args["#queue"].push(["flop", (sharp) => sharp.flop()]);
42
39
 
43
40
  // Exports.
44
- module.exports = {
45
- command: 'flop',
46
- describe: 'Flop the image about the horizontal X axis',
41
+ export default {
42
+ command: "flop",
43
+ describe: "Flop the image about the horizontal X axis",
47
44
  builder,
48
- handler
49
- }
45
+ handler,
46
+ };
@@ -23,44 +23,45 @@
23
23
 
24
24
  // @see https://sharp.pixelplumbing.com/api-operation#gamma
25
25
 
26
- // Strict mode.
27
- 'use strict'
28
-
29
- // Local modules.
30
- const queue = require('../../lib/queue')
31
-
32
26
  // Configure.
33
27
  const positionals = {
34
28
  gamma: {
35
- desc: 'The gamma factor',
29
+ desc: "The gamma factor",
36
30
  defaultDescription: 2.2,
37
- type: 'number'
31
+ type: "number",
38
32
  },
39
33
  gammaOut: {
40
- desc: 'The gamma factor used for scaling',
41
- defaultDescription: '<gamma>',
42
- type: 'number'
43
- }
44
- }
34
+ desc: "The gamma factor used for scaling",
35
+ defaultDescription: "<gamma>",
36
+ type: "number",
37
+ },
38
+ };
45
39
 
46
40
  // Command builder.
47
41
  const builder = (yargs) => {
48
42
  return yargs
49
43
  .strict()
50
- .epilog('For more information on available options, please visit https://sharp.pixelplumbing.com/api-operation#gamma')
51
- .positional('gamma', positionals.gamma)
52
- .positional('gammaOut', positionals.gammaOut)
53
- }
44
+ .epilog(
45
+ "For more information on available options, please visit https://sharp.pixelplumbing.com/api-operation#gamma",
46
+ )
47
+ .positional("gamma", positionals.gamma)
48
+ .positional("gammaOut", positionals.gammaOut);
49
+ };
54
50
 
55
51
  // Command handler.
56
- const handler = (args) => queue.push(['gamma', (sharp) => {
57
- return sharp.gamma(args.gamma, args.gammaOut)
58
- }])
52
+ const handler = (args) =>
53
+ args["#queue"].push([
54
+ "gamma",
55
+ (sharp) => {
56
+ return sharp.gamma(args.gamma, args.gammaOut);
57
+ },
58
+ ]);
59
59
 
60
60
  // Exports.
61
- module.exports = {
62
- command: 'gamma [gamma] [gammaOut]',
63
- describe: 'Apply a gamma correction by reducing the encoding (darken) pre-resize then increasing the encoding (brighten) post-resize',
61
+ export default {
62
+ command: "gamma [gamma] [gammaOut]",
63
+ describe:
64
+ "Apply a gamma correction by reducing the encoding (darken) pre-resize then increasing the encoding (brighten) post-resize",
64
65
  builder,
65
- handler
66
- }
66
+ handler,
67
+ };