nativeImage.createFromBuffer scaleFactor


#1

Trying to scale an image received from the capturePage API method, like this:

var scaled = nativeImage.createFromBuffer(image.toPng(), 2.0);
fs.writeFile('scaled.png', scaled.toPng(), function(err) {
   //...
});

But the resulting image files are empty. Any ideas?
If I set the scaleFactor to 1.0, the images are good but not scaled.

The reason I need to scale the image is because the image comes back from “capture” scaled by the devicePixelRatio of the webContent. So I am trying to return the image back to it’s intended size. If anyone knows of a work around to this, I am all ears.
I have tried some Nodejs image libraries but using those creates an issue when compiling for multiple platforms.