Questions tagged [imagemin]
91 questions
3
votes
3 answers
How can I load webp images after these are generated by imagemin-webp-webpack-plugin?
I was configuring imagemin-webp-webpack-plugin to convert all my .png and .jpg images in my src/assets/images to dist/assets/images. When I ran my build command, the conversion was successful. All images had been converted to webp and distributed to…

Wilbert Caba
- 530
- 1
- 6
- 13
3
votes
0 answers
ImageminPlugin with CustomWeback in Angular doesn't work in production
// webpack.config.js
const ImageminPlugin = require('imagemin-webpack-plugin').default
module.exports = {
plugins: [
new ImageminPlugin({
pngquant: {
quality: '50' // unreasonably low value to see it works
}
})
…

Michal
- 4,952
- 8
- 30
- 63
3
votes
0 answers
using image resize library imagemin in vuejs throws error Cannot read property 'dirname' of undefined
i'm trying to use the image resize library imagemin in vue.js but it's throwing me this error after i installed imagemin-mozjpeg. i have not started using it just importing it throws error. this is the error.
Uncaught TypeError: Cannot read property…

Naveen Kashyap
- 372
- 1
- 9
3
votes
2 answers
Does the WebPack entry have to be a JavaScript File
When you use WebPack, you typically have to set an entry point to a .js file. Is this a requirement? I have two scenarios:
I want to convert a .scss to a .css file.
I want to minify images using imagemin.
I don't have or need any JavaScript. How…

Muhammad Rehan Saeed
- 35,627
- 39
- 202
- 311
3
votes
1 answer
Gulp optimize images with imagemin
I'm trying to Gulp optimize my images with imagemin
https://www.npmjs.com/package/gulp-image-optimization
I have problem to find a good documentation which can show me exact parameters and different option. For now there is not a lot of gain in my…

Kevin
- 4,823
- 6
- 36
- 70
3
votes
1 answer
Gulp imagemin dest.on is not a function error
I'm trying to minify images with imagemin, but it falls with an error.
Can't understand what I've done wrong.
Here is my gulpfile
'use strict';
var gulp = require('gulp');
var imagemin = require('imagemin');
var clean =…

BigKompot
- 35
- 1
- 5
3
votes
0 answers
Error with ImageMin in Gulp
When I run the gulp command I get the following error:
events.js:141
throw er; // Unhandled 'error' event
^
Error: write EPIPE
at Object.exports._errnoException (util.js:874:11)
at exports._exceptionWithHostPort…

Velibor Nikolic
- 239
- 3
- 15
3
votes
3 answers
Grunt build fail due to imagemin issue, what is wrong?
I am trying to build an app using grunt build and I got this error:
# grunt build
Running "clean:dist" (clean) task
Running "wiredep:app" (wiredep) task
Running "wiredep:sass" (wiredep) task
Running "includeSource:dist" (includeSource) task
File…

ReynierPM
- 17,594
- 53
- 193
- 363
2
votes
1 answer
image-minimizer-webpack-plugin generator keep originals
When i load an image in my webpack i want to optimize that image AND make a webp of that image.
Im using image-minimizer-webpack-plugin with minimizer AND generator options, but it only generates the webp, the original version is deleted
…

rodriciru
- 141
- 2
- 9
2
votes
2 answers
nodejs - how to prevent the exif image auto rotate
I am using imagemin to minimize the image size.
After that, I find that the minimized image changed from portrait to landscape, which is unexpected for me.
Is there any way to prevent it from rotating?
...
async function minimizeImage(data){
…

CCCC
- 5,665
- 4
- 41
- 88
2
votes
1 answer
Imagemin in Electron App Not Compressing Images
I'm trying to compress a single PNG image in an Electron application using this code
const files = await imagemin([filePath], {
destination: destinationPath,
plugins: [
imageminPngquant({
quality: [0.2, 0.4],
speed:…

LKM
- 4,351
- 3
- 27
- 22
2
votes
0 answers
How to minimize images in subfolders with imagemin and CopyWebpack plugins?
Edit
Solution
I used already compressed pictures. Don't know, why.
So the pictures in the subdirectories are compressed, but only if they aren't already.
Goal
Compress and copy all images from within directory "frontend/images" to…

leonp5
- 305
- 7
- 23
2
votes
3 answers
npm run watch Error in Cannot read property of 'map' undefined
Problem:
Running the command npm run watch throws and error
54% building 35/41 modules 6 active…

Protomancer
- 140
- 13
2
votes
0 answers
Avoid compressing image twice using imagemin
I have several directories of images that I have compressed using Imagemin. I would like to add my script to my build so when new images are added they are automatically compressed. How would I go about checking if an image is already compressed so…

Vinicius Tavares
- 21
- 2
2
votes
1 answer
Transform photo with imagemin before uploading to s3 using multer-s3-transform
I was trying to use multer-s3-transform in uploading my photo to s3, but before that I need to transform the image to much lower file size using imagemin. I was able to do it using sharp but still want to try it using imagemin to specifically set…

virtualninja
- 192
- 3
- 16