I am scrapping information from e-commerce websites, in that information image also is there. Downloaded images are in different sizes. I want that images in default size. How to do it Node.js?
Asked
Active
Viewed 1,335 times
0
-
I think you can refer to this question: [resize-a-base-64-image-in-javascript-without-using-canvas](http://stackoverflow.com/questions/20958078/resize-a-base-64-image-in-javascript-without-using-canvas) – Gabriel Cheung Nov 11 '16 at 06:21
-
Maybe have a look at this node module: http://aheckmann.github.io/gm. It wraps the GraphicsMagick lib into a node module and should provide a lot of functionality to manipulate images. – Tobi Nov 11 '16 at 06:32
1 Answers
1
You can create a gulp/grunt task for this OR you can use available module called gm :GM MODULE
var gm = require('gm');
gm('/path/to/image.jpg')
.resize(353, 257)
.autoOrient()
.write(writeStream, function (err) {
if (!err) console.log(' hooray! ');
});

Gaurav joshi
- 1,743
- 1
- 14
- 28