When I try to execute this simple example of code using gm and nodejs on Windows:
var gm = require('gm').subClass({imageMagick: true});
gm(50, 50, '#000F')
.setFormat('img')
.fill('black')
.drawCircle( 50, 50, 60, 60 )
.toBuffer(function( error, buffer ) {
if( error ) { console.log( error ); return; }
console.log( 'success: ' + buffer.length );
}
);
I get the error:
[Error: Stream yields empty buffer]
Why is this error happining and how can I solve it ?