Closed raunakdoesdev closed 1 year ago
This is due to missing dynamic modules support on Deno, which was fixed with commit 997031a94dcf5e2989c5456d664be78634a9a61e.
You can workaround this by disabling support for this (which implies that support for JPEG XL images is also disabled). For example:
import Vips from 'https://cdn.jsdelivr.net/npm/wasm-vips/lib/vips-es6.js';
const vips = await Vips({
dynamicLibraries: []
});
// Load a formatted image from buffer
const buffer = await Deno.readFile('playground/src/images/banana.webp');
const thumbnail = vips.Image.thumbnailBuffer(buffer, 500, {
option_string: '[n=-1]',
height: 500
});
// Write the result to a blob
const outBuffer = thumbnail.writeToBuffer('.gif');
await Deno.writeFile('banana.gif', outBuffer);
// Exit the Deno runtime (i.e. a more "commandline" experience)
Deno.exit();
$ deno run --allow-net --allow-read --allow-write test.js
v0.0.5 now available, which includes support for dynamic modules on Deno.
Running the await Vips() snippet form the README on Deno results in the following: