-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pngStream End Before File is writen #802
Comments
This is expected, out.on('finish', () => console.log('saved png')) |
@LinusU In that case, we may want to update this README example: https://github.com/Automattic/node-canvas#canvaspngstreamoptions |
Great catch! I’m on mobile now so can’t do it myself, PR welcome or I’ll fix it after the weekend :) |
Issue or Feature
I'm currently working on a script that takes the output from a roll20 API wrote and merge the map data down to a single image. This was due to the fact that a couple of my maps are so big that a few of my maps were so large with so many different elements it was crashing a few of my players.
So i wrote this to rebuild the map in a canvas and save it off as a single PNG. The problem is when i do this. I seem to get the 'saved png' message far before the actually file is finished being written.
The Final PNG size in my tests was almost 300MB in size.
Steps to Reproduce
var fs = require('fs')
, out = fs.createWriteStream(__dirname + '/text.png')
, stream = canvas.pngStream();
stream.on('data', function(chunk){
out.write(chunk);
});
stream.on('end', function(){
console.log('saved png');
});
Your Environment
The text was updated successfully, but these errors were encountered: