Questions tagged [imagemin]
91 questions
10
votes
2 answers
Why don't newly added files trigger my gulp-watch task?
I have a gulp task which uses gulp-imagemin to compress images. When I add new files to this directory I'd like for this task to compress them as well. I read that gulp.watch doesn't trigger on new files and that I should try gulp-watch so I used it…

Jesse Hattabaugh
- 7,876
- 8
- 34
- 38
9
votes
4 answers
Grunt imagemin error: Cannot read property 'contents' of undefined
Grunt imagemin throws the following error when I try to run it:
Running "imagemin:dynamic" (imagemin) task
Fatal error: Cannot read property 'contents' of undefined
Here's my package.json file:
{
"name": "project1",
"version": "0.1.0",
…

Justin Smith
- 346
- 1
- 3
- 17
8
votes
4 answers
is it possible to use imagemin-cli and keep the same folder structure of compressing files?
I'm trying to create imagemin script with npm scripts and using imagemin-cli for it. First, I copy files to dist (or .tmp for development) folder and then compress images with this scripts:
package.json
...
scripts {
"copy:dev": "cpx…

lalexa
- 443
- 3
- 8
- 16
8
votes
1 answer
How do I get the best PNG compression with gulp-imagemin + plugins?
I am trying to get the best setup possible for compressing pngs.
I have found there are some plugins available here for imagemin:
https://www.npmjs.com/browse/keyword/imageminplugin
I have tried all the PNG options but the compression rates appear…

joep
- 258
- 3
- 11
8
votes
1 answer
Yeoman: Cannot find 'imagemin-jpegtran'
I've been searching a solution for this error for over a week and cannot find anything. I can't build my dist package on Yeoman due to this imagemin-jpegtran
I tried to upload an image to show the error and make things easier but Stackoverflow…

brunodd
- 2,474
- 10
- 43
- 66
7
votes
3 answers
Can you compress angular image assets on build?
What I want
I have very big images in my assets, which slows down the site by a lot for slower networks. (you can read more about the topic on this lighthouse linked page)
I would like to compress them at build time (ng build --prod).
For local…

MauriceNino
- 6,214
- 1
- 23
- 60
7
votes
3 answers
Not able to convert images to WebP using imagemin-webp
I'm trying to convert more than one PNG and JPG file to WebP using imagemin-webp instead of using cwebp to convert one at a time, but it is not working for some reason.
Everything I've done so far:
1- I installed Node JS v10.16.0;
2- From inside my…

Fb16455
- 101
- 1
- 7
6
votes
1 answer
when npm i imagemin say itself not install?WARN img-loader@3.0.0 requires a peer of imagemin@^5.0.0 but none is installed
npm -v
6.4.1
nvm --version
0.33.11
when I install laravel-echo (in ubuntu16.04)
npm i --save socket.io-client
I got the error warning
npm WARN ajv-keywords@3.2.0 requires a peer of ajv@^6.0.0 but none is installed. You must install peer…

robspin
- 771
- 3
- 14
- 33
6
votes
5 answers
Node.js imagemin on CentOS
I am trying to use Node.js imagemin to compress a lot of images on my server. I like using imagemin because I know how to point it at specific directories.
I am using CentOS 6 and when I run my file, I get the…

Sean
- 1,758
- 3
- 20
- 34
5
votes
0 answers
Gulp Imagemin "MaxBufferError: stdout maxBuffer exceeded" when I try to minify large amount of files
Gulp Imagemin errors MaxBufferError: stdout maxBuffer exceeded when I try to minify a large amount of files (230). It will run the task if I minify 40-50 files at a time.
How do Increase the buffer? Or stop the task discontinuing?
node version…

MrThunder
- 725
- 12
- 21
5
votes
0 answers
grunt imagemin error: Fatal error: write EPIPE
I'm getting the above error when I run the grunt dist, It worked perfectly fine with my other machine.
Please find my gruntfile.
$ grunt imagemin.
Running "imagemin:png" (imagemin) task
Minified 132 images (saved 134.02 kB)
Running "imagemin:gif"…

Sai Prakash Narasingu
- 95
- 1
- 11
5
votes
4 answers
Fatal error: This socket is closed , when I test grunt-contrib-imagemin
I am testing the plugin grunt-contrib-imagemin for jpg minify. But it always failed as
Running "imagemin:dynamic" (imagemin) task
Fatal error: This socket is closed.
Source :
grunt.initConfig({
imagemin: { // Task
dynamic: { …

Leslie
- 51
- 4
4
votes
1 answer
Can someone walk me through how to use imagemin-webp in my react app (firebase)?
I want to convert all images into webp but I don't know how (programming noob). I built a react app, I have a firebase.json, and I have the script "build": "react-app-rewired build" in my package.json.
Where do I put the codes and how to I wire…

changshou
- 59
- 4
4
votes
2 answers
How to lossless optimize images with plugins for grunt-contrib-imagemin?
I am trying to lossless optimize JPEG / PNG images with imagemin, but I have a problem when using extensions, they "deoptimize", meaning the result image is bigger than the original. How can I prevent this?
This is my…

max4ever
- 11,909
- 13
- 77
- 115
3
votes
1 answer
Webpack ImageMinimizerPlugin "imageminMinify" function do not support generate to "jpg"
I have updated my image-minimizer-webpack-plugin package from version 2 to 3 and looking at their documentation, I first installed imagemin package and then updated my webpack.config.js. In version 2, I had the following in my config file:
new…

AkbarB
- 460
- 7
- 24