await sharp({
create: {
width: size.width,
height: size.height,
channels: 4,
background: { r: 255, g: 255, b: 255, alpha: 1 },
},
})
.composite(compositeImages)
.toFile(Date.now() + '.png')
.catch((err) => console.log('Error occured, skip'))
As you can see I have this code here. What I try to do is creating a background and then composite 2 or 3 images over it. But .toFile() does not seem to work and I don't know why.
I have also tried to .png() and to .raw() after composite. Also nothing happens. I tried to use fs.writeFile() also nothing happens.
What am I doing wrong here?
Edit: If i remove the .composite() it suddenly writes the file.