Merge pull request #17229 from ShirasawaSama/feat/dynamic-load-heic2any
feat: dynamically load heic2any in channel MessageInput
This commit is contained in:
@@ -1,7 +1,6 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { toast } from 'svelte-sonner';
|
import { toast } from 'svelte-sonner';
|
||||||
import { v4 as uuidv4 } from 'uuid';
|
import { v4 as uuidv4 } from 'uuid';
|
||||||
import heic2any from 'heic2any';
|
|
||||||
|
|
||||||
import { tick, getContext, onMount, onDestroy } from 'svelte';
|
import { tick, getContext, onMount, onDestroy } from 'svelte';
|
||||||
|
|
||||||
@@ -9,7 +8,7 @@
|
|||||||
|
|
||||||
import { config, mobile, settings, socket, user } from '$lib/stores';
|
import { config, mobile, settings, socket, user } from '$lib/stores';
|
||||||
import {
|
import {
|
||||||
blobToFile,
|
convertHeicToJpeg,
|
||||||
compressImage,
|
compressImage,
|
||||||
extractInputVariables,
|
extractInputVariables,
|
||||||
getAge,
|
getAge,
|
||||||
@@ -379,7 +378,7 @@
|
|||||||
|
|
||||||
reader.readAsDataURL(
|
reader.readAsDataURL(
|
||||||
file['type'] === 'image/heic'
|
file['type'] === 'image/heic'
|
||||||
? await heic2any({ blob: file, toType: 'image/jpeg' })
|
? await convertHeicToJpeg(file)
|
||||||
: file
|
: file
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user