-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
47 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,48 @@ | ||
# letsenhance | ||
Command line client for letsenhance.io - Enhance images in a directory | ||
|
||
## Usage: | ||
|
||
#### Command line | ||
`letsenhance [options] email password /path/source /path/dest` | ||
|
||
|
||
#### Node | ||
``` | ||
const Enhancer = require('letsenhance'); | ||
async function enhance() { | ||
const enhancer = new Enhancer(options); | ||
let err = await enhancer.login(email, password); | ||
if (err) { | ||
return console.log('Login failed.'); | ||
} | ||
err = await enhancer.enhanceDir(sourcePath, destPath); | ||
if (err) { | ||
return console.log(`Error while processing: ${err}`); | ||
} | ||
console.log('Processing complete!'); | ||
} | ||
enhance(); | ||
``` | ||
|
||
### Options: | ||
**`--type`** string - `JPEG` (default) or `PNG`; PNG yields a larger file that maintains its quality across any subsequent alterations (jpeg does not); | ||
**`--version`** string - `magic` (default, for photographs), `boring` (for everything else), `color-enhance`, `tone-enhance`; | ||
**`--mode`** string - `Auto` (default); Auto is the only supported transformation mode at the moment; | ||
**`--maxParallel`** number - 10 (default); how many files to process at a time; use a lower value if you encounter frequent issues; | ||
**`--attempts`** number - 6 (default); how many times to re-attempt an operation after a 'soft' failure; the default value should suffice; | ||
**`--progressInterval`** number - 15 (default); how many seconds to wait before checking a file's progress; use a greater value if an error message suggests it (e.g. 30 or higher); | ||
**`--stopOnFirstFailedFile`** boolean - `true` (default) or `false`; stop the entire process on a 'hard' failure (used to prevent wasting available transformations); | ||
|
||
#### Example with options: | ||
`letsenhance --type PNG --version boring --maxParallel 8 --progressInterval 30 [email protected] joespassword /path/source /path/dest` | ||
|
||
## Notes: | ||
Options must be placed before the email string. | ||
If the paths or password contain spaces, use quotes: '/path to a dir' or "/path to another dir". | ||
Make sure there are only images in the source path directory; other files will cause errors and eventually halt the process. Hidden files starting with '.' are ignored. | ||
Don't use an option without a value, it may lead to unexpected results. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters