You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
const{ promises }=require('node:fs')const{ join }=require('node:path')const{ createCanvas, loadImage }=require('@napi-rs/canvas')constbackCanvas=createCanvas(1920,1080);constbackCtx=backCanvas.getContext('2d');constpicCanvas=createCanvas(640,480);constpicCtx=picCanvas.getContext('2d');asyncfunctionmain(){backCtx.fillStyle='#000000';backCtx.fillRect(0,0,1920,1080);// load images from disk or from a URLconstcatImage=awaitloadImage('cat_640x480.jpg');picCtx.drawImage(catImage,0,0,catImage.width,catImage.height)backCtx.drawImage(picCanvas,240,0,1440,1080);// export canvas as imageconstpngData=awaitbackCanvas.encode('png');awaitpromises.writeFile(join(__dirname,'stretched-cat.png'),pngData);}main();
In 0.1.65 this correctly produces:
however in 0.1.66 it produces:
This is also a bug when using the resizing parameters in context.putImageData()
The text was updated successfully, but these errors were encountered:
Here's a test case using this cat picture:
In 0.1.65 this correctly produces:
however in 0.1.66 it produces:
This is also a bug when using the resizing parameters in
context.putImageData()
The text was updated successfully, but these errors were encountered: