javascript - Node.js GraphicsMagick append an image without saving the file -
i looking append , image simple. need create image gm, , place @ bottom of without saving first image on server. it's easy if can save images first, things go, that's not case.
create image
gm(600, 100, '#000') .fill('rgba(0,0,0,0.7)') .fill('#fff') .font("arial.ttf", 16) .drawtext(15, 30, 'heading here') .drawtext(15, 55, "lorem ipsum dolor sit amet") .write('text.jpg', function (err) { if (err){ console.log(err) } else { console.log('done'); } }); resize , append first image:
gm('img.jpg') .resize(600) .append('bottom.jpg') .write('finished.jpg', function (err) { if (err){ console.log(err) } else { console.log('done'); } }); is there way can without writing first file?
Comments
Post a Comment