You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 22, 2024. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+10-8Lines changed: 10 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -253,6 +253,7 @@ All keys in the configuration object have [Typescript](#typescript) typings that
253
253
254
254
**Note:** The supported keys for codec specific settings are:
255
255
256
+
- exportOriginal
256
257
- exportWebp
257
258
- resize
258
259
- optimize
@@ -395,19 +396,19 @@ Even without modern editor, you can consult the generated `*.d.ts` typing files
395
396
396
397
## Optimization
397
398
398
-
Image optimization uses *pngquant*, *mozjpeg*, *svgo*, *gifsicle*and *cwebp* to reduce the output image size as much as possible. By default, it's very aggressive, and also very slow. In most situations it will take more time than the resize process. If `optimize` is set to `false`, then the image will be saved directly from SHARP using default codec settings, instead of being sent to the optimizer first.
399
+
Image optimization uses *pngquant*, *mozjpeg*, *svgo*and *gifsicle* to reduce the output image size as much as possible. By default, it's very aggressive, and also very slow. In most situations it will take more time than the resize process. If `optimize` is set to `false`, then the image will be saved directly from SHARP using default codec settings, instead of being sent to the optimizer first.
399
400
400
-
You can override all of the optimizer settings by specifying the `optimizerSettings` key in the configuration object (must be under on of the `png`, `jpeg`, `svg`or `gif` keys).
401
+
You can override all of the optimizer settings by specifying the `optimizerSettings` key in the configuration object (must be under on of the `png`, `jpeg`, `svg`, `gif`or `webp` keys).
401
402
402
-
See [imagemin-pngquant](https://www.npmjs.com/package/imagemin-pngquant), [imagemin-mozjpeg](https://www.npmjs.com/package/imagemin-mozjpeg), [imagemin-svgo](https://www.npmjs.com/package/imagemin-svgo), [imagemin-gifsicle](https://www.npmjs.com/package/imagemin-gifsicle)and [imagemin-webp](https://www.npmjs.com/package/imagemin-webp)for the available optimization options.
403
+
See [imagemin-pngquant](https://www.npmjs.com/package/imagemin-pngquant), [imagemin-mozjpeg](https://www.npmjs.com/package/imagemin-mozjpeg), [imagemin-svgo](https://www.npmjs.com/package/imagemin-svgo) and [imagemin-gifsicle](https://www.npmjs.com/package/imagemin-gifsicle)for the available optimization options. For WebP, you must use the [SHARP configuration object](https://sharp.dimens.io/en/stable/api-output/#webp)instead, as `imagemin-webp` seems to have compatibility issues with libvips.
403
404
404
405
Usually WebP provides a ~40% difference in file reduction, however you may need to play around with the optimizer settings to achieve this. I have chosen some opinionated settings to try to achieve web-type compression. Specifying a an empty object `{}` as the `optimizerSettings` for the codec (in the config) will override the default settings and revert to the plugin defaults.
405
406
406
407
### Performance
407
408
408
409
RIB has been rewritten from the ground up to be more efficient than previous versions. Instead of writing vast quantities of raw image data to memory buffers for every operation, the new version leverages the performance of Node.js streams, reducing the memory footprint without sacrificing any speed.
409
410
410
-
For each image job, a tree-like stream network is created that flows data from the source image, through the resize and optimizer streams before being redirected back to the disk. This allows image data to flow through the network as needed until all write streams close, small packets at a time.
411
+
For each image job, a tree-like stream network (that is referred to as a pipeline in this documentation) is created that flows data from the source image, through the resize and optimizer stream modifiers before being redirected back to the disk. This allows image data to flow through the network as needed until all write streams close, small packets at a time.
411
412
412
413
On a high-end system, you may expect to process a thousand high-quality 4K images a minute with the default program configuration.
413
414
@@ -430,7 +431,7 @@ Please make sure that your contributions pass tests before submitting a Pull Req
430
431
431
432
It's hard to make short error messages easy to understand. You can find a description of the error here.
432
433
433
-
RIB error codes are formatted as the letter E, followed by four digits.
434
+
RIB error codes are formatted as the letter E, followed by three digits.
@@ -462,6 +463,8 @@ Important files were detected in the output folder, and the user aborted the cle
462
463
463
464
The controller is in charge of the worker cluster and handles job delegation.
464
465
466
+
All errors are passed through the the Main class.
467
+
465
468
### Thread errors
466
469
467
470
These errors are thrown by the image processing thread.
@@ -481,15 +484,15 @@ An unlikely error, the image disappeared since the input directory was scanned d
481
484
482
485
#### E503 - Not a file
483
486
484
-
An unlikely error. The path for the image was no-longer a file.
487
+
An unlikely error. The path for the image was nolonger a file.
485
488
486
489
</details>
487
490
488
491
## Built With
489
492
490
493
*[NodeJS](https://nodejs.org) - Powered by Chrome's V8 Javascript engine
491
494
*[SHARP](https://github.com/lovell/sharp) - A fantastic Node.js wrapper around the [libvips](https://github.com/jcupitt/libvips) library
492
-
*[Dynamic Terminal](https://github.com/marcuscemes/dynamic-terminal) My very own terminal logging library
495
+
*[Dynamic Terminal](https://github.com/marcuscemes/dynamic-terminal)- My very own terminal logging library
493
496
494
497
### Milestones
495
498
@@ -503,7 +506,6 @@ An unlikely error. The path for the image was no-longer a file.
503
506
-[ ] Support "synchronize" mode where only missing images are exported
504
507
-[ ] Add checksum to manifest for better image searching
505
508
-[ ] Add example with new WebP optimizer and better optimizer settings
506
-
-[ ] Consider removing dependency and use compiled encoders directly
507
509
-[x] Add exportOriginalCodec option
508
510
-[x] Add support for imagemin-webp [REVERTED DUE TO BUG]
509
511
-[x] Avoid double-compressing a file when optimizer is enabled
0 commit comments