Comments (1)
@n3pixowe
Hello, N3pixowe .
Thank you for your question.
Update to new version 1.4.5
var compress_images = require('compress-images'), INPUT_path_to_your_images, OUTPUT_path;
INPUT_path_to_your_images = 'src/img/**/*.{jpg,JPG,jpeg,JPEG,png,svg,gif}';
OUTPUT_path = 'build/img/';
compress_images(INPUT_path_to_your_images, OUTPUT_path, {compress_force: false, statistic: true, autoupdate: true}, false,
{jpg: {engine: 'mozjpeg', command: ['-quality', '60']}},
{png: {engine: 'pngquant', command: ['--quality=20-50']}},
{svg: {engine: 'svgo', command: '--multipass'}},
{gif: {engine: 'gifsicle', command: ['--colors', '64', '--use-col=web']}}, function(error, completed, statistic){
console.log('-------------');
console.log(error);
console.log(completed);
console.log(statistic);
console.log('-------------');
});
See Doc
callback (err, completed): returns:
err (type:json object|null)
engine - The name of the algorithm engine
input - The path to the input image
output - The path to the output image
completed (type:boolean)
true - result completed.
false - result not completed.
statistic (type:json object)
input
path_out_new
algorithm
size_in
size_output
percent
err
from compress-images.
Related Issues (20)
- images are not saved to exact paths HOT 12
- Suggestions to avoid passing excessive arguments and use well-constructed options HOT 1
- GIF-LIB error: Image EOF detected before image complete. HOT 4
- Support to Typescript HOT 5
- Get an error during installing module HOT 3
- Exclude folder HOT 1
- Error of inputting path HOT 1
- Does it protect itself from zip bombs ? HOT 2
- Is it possible to resize ? HOT 3
- Update Dependencies HOT 4
- file does not exist when it does? HOT 1
- Why the finally file size has increased? HOT 2
- tell me to install a additional module HOT 6
- Compatibility with pngquant-bin v7 HOT 5
- Unrecognized option: 'u' HOT 1
- why gif become blurry after run "compress_images.js" HOT 1
- Ability to input the file instead of its path HOT 1
- error Error [TypeError]: Cannot read properties of undefined (reading 'engine')
- Outdated dependency update?
- How do I disable logging and statistics? HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from compress-images.