Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Reuse

Manav Rathi27f18b5936fe
diff --git a/web/apps/photos/src/services/upload/thumbnail.ts b/web/apps/photos/src/services/upload/thumbnail.ts
index 281a91fa52..648e49e749 100644
--- a/web/apps/photos/src/services/upload/thumbnail.ts
+++ b/web/apps/photos/src/services/upload/thumbnail.ts
@@ -1,6 +1,7 @@
import log from "@/base/log";
import { type Electron } from "@/base/types/ipc";
import { FileType, type FileTypeInfo } from "@/media/file-type";
+import { isHEICExtension } from "@/media/formats";
import { heicToJPEG } from "@/media/heic-convert";
import { scaledImageDimensions } from "@/media/image";
import * as ffmpeg from "@/new/photos/services/ffmpeg";
@@ -59,7 +60,7 @@ const generateImageThumbnailWeb = async (
blob: Blob,
{ extension }: FileTypeInfo,
) => {
- if (extension == "heic" || extension == "heif") {
+ if (isHEICExtension(extension)) {
log.debug(() => `Pre-converting HEIC to JPEG for thumbnail generation`);
blob = await heicToJPEG(blob);
}
diff --git a/web/packages/new/photos/utils/file.ts b/web/packages/new/photos/utils/file.ts
index 6aab6e7017..0e698b6051 100644
--- a/web/packages/new/photos/utils/file.ts
+++ b/web/packages/new/photos/utils/file.ts
@@ -2,7 +2,7 @@ import { isDesktop } from "@/base/app";
import log from "@/base/log";
import { CustomErrorMessage } from "@/base/types/ipc";
import { workerBridge } from "@/base/worker/worker-bridge";
-import { needsJPEGConversion } from "@/media/formats";
+import { isHEICExtension, needsJPEGConversion } from "@/media/formats";
import { heicToJPEG } from "@/media/heic-convert";
import { detectFileTypeInfo } from "./detect-type";
@@ -80,7 +80,7 @@ export const renderableImageBlob = async (
// available on this platform, for HEIC/HEIF files we can fallback
// to our web HEIC converter.
- if (extension == "heic" || extension == "heif") {
+ if (isHEICExtension(extension)) {
return await heicToJPEG(imageBlob);
}
}