mirror of
https://github.com/kmc7468/arkvault.git
synced 2025-12-16 06:58:46 +00:00
heic2any를 동적으로 import하도록 변경
This commit is contained in:
@@ -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,
|
||||
);
|
||||
|
||||
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user