Answer the question
In order to leave comments, you need to log in
How to compress images through NPM scripts?
I'm looking for an npm package that will compress images in a folder specified in the project on the PC and all folders inside it. You need to run something like "npm --img-compression". Could you tell me, please, what package can be used to do something like this?
Answer the question
In order to leave comments, you need to log in
There is a ready-made Gulp plugin for this.
There are many vids on youtube on it.
imagemin (without Gulp)
Install a module, make a file according to the model. It will be launched via node fileName.js
If desired, you can add an alias to package.json --> scripts and call vianpm run aliasName
To open a spinner, it is usually enough to make
sure that this method is called after the spinner has been initialized and does not entail other errors.
In such matters, the code will not be superfluous.
Try like this:
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
spinner.performClick();
}
}, 200);
new AsyncTask<Void, Void, Void>() {
@Override
protected Void doInBackground(Void... voids) {
runOnUiThread(new Runnable() {
@Override
public void run() {
spinner.notifyDataSetChanged();
}
});
return null;
}
@Override
protected void onPostExecute(Void aVoid) {
super.onPostExecute(aVoid);
spinner.performClick();
}
}.execute();
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question