Reuse
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user