From 9eb66b4fa364ed8f5ab491adc6570939bdac9abd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Kr=C3=BCger?= Date: Mon, 17 Nov 2025 12:02:05 +0100 Subject: [PATCH] fix: add proper ImageMagick WASM initialization with CDN URL MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The initializeImageMagick() function requires a URL argument pointing to the WASM file. Without it, the library won't properly load and conversions may fail. Changes: - Add initializeImageMagick() call with CDN URL - Use jsDelivr CDN for magick.wasm file - Matches the installed package version (0.0.30) This ensures ImageMagick WASM is properly initialized before performing image conversions, preventing potential runtime errors. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- lib/converters/imagemagickService.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/converters/imagemagickService.ts b/lib/converters/imagemagickService.ts index fe97d05..9368b9c 100644 --- a/lib/converters/imagemagickService.ts +++ b/lib/converters/imagemagickService.ts @@ -26,7 +26,11 @@ export async function convertWithImageMagick( if (onProgress) onProgress(30); // Import ImageMagick functions - const { ImageMagick } = await import('@imagemagick/magick-wasm'); + const { ImageMagick, initializeImageMagick } = await import('@imagemagick/magick-wasm'); + + // Initialize ImageMagick with WASM URL from CDN + const wasmUrl = 'https://cdn.jsdelivr.net/npm/@imagemagick/magick-wasm@0.0.30/dist/magick.wasm'; + await initializeImageMagick(wasmUrl); if (onProgress) onProgress(40);