aheckmann / gm

GraphicsMagick for node
http://aheckmann.github.com/gm/
6.96k stars 614 forks source link

text disappears - svg to png #496

Open hmsommer opened 8 years ago

hmsommer commented 8 years ago

I am trying to make an endpoint that would receive an SVG and output a PNG. However all of my SVGs have the text element in them and whenever this runs it stops and output everything in the image prior to the first text element. Potentially a bug?

  app.post('/keepsakes/:title', function (req, res) {
    var gm = require('gm'),
    imageMagick = gm.subClass({ imageMagick: true });
    var svg = '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>' + req.body.svgCode;
    var buf = new Buffer(svg);
    res.set('Content-Type', 'image/png');
    imageMagick(buf, 'img.svg').stream('png', function (err, stdout, stderr) {
      stdout.pipe(res);
    });
   });
IsaiahJTurner commented 8 years ago

I am experiencing this bug as well, did you find a solution?