Closed punarinta closed 10 months ago
This repo contains only the code from https://github.com/dlemstra/magick-wasm converted for Deno compatibility. Can you reproduce this error with the original Node version?
@oscarotero the code with the original library works well:
const { ImageMagick, initializeImageMagick, MagickFormat } = require('@imagemagick/magick-wasm')
const fs = require('fs')
const imageData = fs.readFileSync('image.png')
const wmData = fs.readFileSync('watermark.png')
const _ = (async () => {
await initializeImageMagick()
ImageMagick.read(wmData, wm => {
ImageMagick.read(imageData, image => {
image.composite(wm)
image.write(
MagickFormat.Jpeg,
data => fs.writeFileSync('result.png', data),
)
})
})
})()
Apparantly this was the problem: https://github.com/dlemstra/magick-wasm/issues/93#issuecomment-1563459037 Problem solved. Sorry for a false alarm.
The following code
results in the following error