D
D
David Lomidze2015-07-29 10:11:59
Images
David Lomidze, 2015-07-29 10:11:59

Which plugin to use to compress images with Grunt?

Hello,
There is such a situation: on the site, users upload images up to one megabyte. They need to be compressed with Grunt. I used the imagemin plugin before, but the problem is that every time this plugin was run, it would compress all the images in their entirety. Well, let's say there are 1000 photos already compressed, the user uploaded another one and imagemin started to compress all 1001 photos again, even those that he had already compressed before. And such an operation overloads the entire server.
Can you advise me some plugin for Grunt that would compress only new photos, and not touch the old ones, already compressed, so that there would be no frantic load on the server?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
W
webpixel, 2015-07-29
@webpixel

You are solving the problem from the wrong end, you only need https://github.com/tschaub/grunt-newer

D
Denis Ineshin, 2015-07-29
@IonDen

For the first time I hear that such an operation is done using the Grunt collector. This is 100% the task of the server, and some plugin, such as Imagemagic

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question