fix: increased image loading times from magick loading

This commit is contained in:
not-nullptr 2025-04-14 11:53:24 +01:00
parent 2b2c9146c2
commit e3174e3ee4
1 changed files with 2 additions and 1 deletions

View File

@ -18,7 +18,6 @@ const unsupportedFrom: string[] = [];
const unsupportedTo = [".dng"];
vipsPromise
.then(() => magickPromise)
.then(() => {
postMessage({ type: "loaded" });
})
@ -51,6 +50,8 @@ const handleMessage = async (message: any): Promise<any> => {
magickRequiredFormats.includes(message.input.from) ||
magickRequiredFormats.includes(message.to)
) {
// only wait when we need to
await magickPromise;
const magick = MagickImage.create(
new Uint8Array(buffer),
new MagickReadSettings({