mirror of
https://github.com/kmc7468/arkvault.git
synced 2025-12-16 06:58:46 +00:00
heic 파일에 대한 썸네일 지원 추가 및 카테고리 페이지에서도 파일의 썸네일이 표시되도록 개선
This commit is contained in:
@@ -21,7 +21,16 @@ export const generateThumbnail = limitFunction(
|
||||
async (fileBuffer: ArrayBuffer, fileType: string) => {
|
||||
let url;
|
||||
try {
|
||||
if (fileType.startsWith("image/")) {
|
||||
if (fileType === "image/heic") {
|
||||
const { default: heic2any } = await import("heic2any");
|
||||
url = URL.createObjectURL(
|
||||
(await heic2any({
|
||||
blob: new Blob([fileBuffer], { type: fileType }),
|
||||
toType: "image/png",
|
||||
})) as Blob,
|
||||
);
|
||||
return await generateImageThumbnail(url);
|
||||
} else if (fileType.startsWith("image/")) {
|
||||
url = URL.createObjectURL(new Blob([fileBuffer], { type: fileType }));
|
||||
return await generateImageThumbnail(url);
|
||||
} else if (fileType.startsWith("video/")) {
|
||||
|
||||
Reference in New Issue
Block a user