Posts

Showing posts with the label fluent-ffmpeg

Generate image ,pdf and Video Thumb using node js

      Using  imagemagick  Generate image thumb                 var im = require( 'imagemagick' );         var image = random() + '.png' ;         var imagepath = 'uploads/images_thumb/' + image;         var pathToFile = path.join(__dirname, req.files[i].path),             pathToSnapshot = path.join(__dirname, '/' + imagepath);         im.resize({             srcPath: pathToFile               , dstPath: pathToSnapshot               , width: 150               , height: 150               , quality: 0               , gravity: "North"         }, function (err, stdout, stderr) {             if (err) {                 console.log(err);             }             console.log( 'resized image ' , pathToSnapshot);             //res.json(pathToSnapshot);         });     Using Gm  Generate Pdf thumb                 var gm = require( 'gm' );       var image = random() + '.p