var fs = require('fs')
, gm = require('gm')
, express = require('express');
var port = (process.env.VCAP_APP_PORT || 3000);
var app = module.exports = express();
app.get('/image', function (req, res) {
gm('DSC03282.JPG')
.resize(width, height)
.noProfile()
.toBuffer(function (err, buffer) {
res.writeHead(200, {'Content-Type': 'image/jpeg' });
res.end(buffer, 'binary');
});
});
app.listen(port);
console.log("Go Image API : 3000");
My Personal notes about IBM Bluemix, Techologies / Tools : AngularJS, NodeJs, grunt, bower, npm, yeoman, git, cloudfoundry
mardi 10 juin 2014
Resize an image with node js
Resize an image with gm & node js:
Inscription à :
Publier les commentaires (Atom)
very nice article keep posting
RépondreSupprimerpower bi training institute in hyderabad
very nice blog wonderful content
RépondreSupprimerpower bi training in hyderabad
very informative - www.tekspotedu.com
RépondreSupprimer