Simple wrapper for rawtherapee-cli with Promises
 
Go to file
Clovis Gauzy e1e0a8a5d4 BSD 3-Clause 2020-11-24 22:58:22 +01:00
LICENSE.md BSD 3-Clause 2020-11-24 22:58:22 +01:00
README.md init commit 2020-11-24 22:55:01 +01:00

README.md

node-rawtherapee

Simple wrapper for rawtherapee-cli with Promises

Warning: rawtherapee-cli use all available core in your system to process images. Running multiple instances at the same time may bloat your server. It's recomanded to use a task manager and process them one-by-one.

Dependencies

Rawtherapee must be installed in the host system and rawtherapee-cli must be directly executable from the command-line.

Installaton

With npm:

npm i --save rawtherapee

With yarn

yarn add rawtherapee

Simple Usage

const rawtherapee = require("rawtherapee");

rawtherapee("/somewhere/something.NEF").then((files) => {
  // `files` is an array containing all processed file paths.
  console.log(files.length, "files processed.");
});

Options

| option | format | values | default | |!===|===|===|===| | replace | boolean | | |

replace

default: false

Replace the existing output file.

allFormats

default: false

presets

default: ['default']

'sidecar', 'sidecar-strict', ''

ignoreBadPreset

default: false

If set to false, any non-existing preset file passed to the presets parameter will throw an error.
If set to true, those files will be ignored (not passed to rawtherapi-cli) and print message in sterr if the DEBUG environment variable is set to any value.

output

default: '/tmp/img'

format

default: 'jpg'

'jpg', 'png' or 'tiff'

depth

default: 8

16, 16f or 32
Only for TIFF and PNG output formats.

compression

default: 92

Only for JPG output formats (PNG compression is hardcoded at 6 in rawtherapi-cli)

subSampling

string or int

default:'4:2:2'

1, '4:2:0', 2, '4:4:4', 3

zip

boolean

default: false

Only for TIFF output format.

onChange

function default: () => {}

Callback function fired every time the status is updated (not based on EventListener) :

Return a simple object who always contains status entry, and maybe file or code.