heic2any를 동적으로 import하도록 변경

This commit is contained in:
static
2025-01-15 08:34:50 +09:00
parent 9f9c52ff94
commit 366f657113
3 changed files with 3 additions and 5 deletions

View File

@@ -1,6 +1,5 @@
<script lang="ts">
import FileSaver from "file-saver";
import heic2any from "heic2any";
import { untrack } from "svelte";
import type { Writable } from "svelte/store";
import { TopBar } from "$lib/components";
@@ -41,6 +40,7 @@
requestFileDownload(data.id, $info.contentIv, $info.dataKey).then(async (res) => {
content = new Blob([res], { type: $info.contentType });
if (content.type === "image/heic" || content.type === "image/heif") {
const { default: heic2any } = await import("heic2any");
contentUrl = URL.createObjectURL(
(await heic2any({ blob: content, toType: "image/jpeg" })) as Blob,
);

View File

@@ -2,8 +2,6 @@ import { error } from "@sveltejs/kit";
import { z } from "zod";
import type { PageLoad } from "./$types";
export const ssr = false; // Because of heic2any
export const load: PageLoad = async ({ params }) => {
const zodRes = z
.object({