瀏覽代碼

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

feat: dynamically load heic2any in channel MessageInput
Tim Jaeryang Baek 1 月之前
父節點
當前提交
fe0665605a
共有 1 個文件被更改,包括 2 次插入3 次删除
  1. 2 3
      src/lib/components/channel/MessageInput.svelte

+ 2 - 3
src/lib/components/channel/MessageInput.svelte

@@ -1,7 +1,6 @@
 <script lang="ts">
 	import { toast } from 'svelte-sonner';
 	import { v4 as uuidv4 } from 'uuid';
-	import heic2any from 'heic2any';
 
 	import { tick, getContext, onMount, onDestroy } from 'svelte';
 
@@ -9,7 +8,7 @@
 
 	import { config, mobile, settings, socket, user } from '$lib/stores';
 	import {
-		blobToFile,
+		convertHeicToJpeg,
 		compressImage,
 		extractInputVariables,
 		getAge,
@@ -379,7 +378,7 @@
 
 				reader.readAsDataURL(
 					file['type'] === 'image/heic'
-						? await heic2any({ blob: file, toType: 'image/jpeg' })
+						? await convertHeicToJpeg(file)
 						: file
 				);
 			} else {