Merge pull request #17225 from ShirasawaSama/feat/dynamic-load-heic2any

feat: dynamically load heic2any to accelerate initial page loading speed and fix heic convert bug
This commit is contained in:
Tim Jaeryang Baek
2025-09-05 16:42:45 +04:00
committed by GitHub
3 changed files with 16 additions and 6 deletions
+2 -3
View File
@@ -1,7 +1,6 @@
<script lang="ts">
import DOMPurify from 'dompurify';
import { marked } from 'marked';
import heic2any from 'heic2any';
import { toast } from 'svelte-sonner';
@@ -28,7 +27,7 @@
} from '$lib/stores';
import {
blobToFile,
convertHeicToJpeg,
compressImage,
createMessagesList,
extractContentFromFile,
@@ -761,7 +760,7 @@
};
reader.readAsDataURL(
file['type'] === 'image/heic'
? await heic2any({ blob: file, toType: 'image/jpeg' })
? await convertHeicToJpeg(file)
: file
);
} else {