π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
Prune
Manav Rathi433d0e81fc4c
diff --git a/web/apps/photos/src/services/face/f-index.ts b/web/apps/photos/src/services/face/f-index.tsindex f1785bfec2..dbc7162fa5 100644--- a/web/apps/photos/src/services/face/f-index.ts+++ b/web/apps/photos/src/services/face/f-index.ts@@ -23,7 +23,6 @@ import {createGrayscaleIntMatrixFromNormalized2List,fetchImageBitmap,getLocalFileImageBitmap,- getThumbnailImageBitmap,pixelRGBBilinear,warpAffineFloat32List,} from "./image";@@ -72,29 +71,21 @@ export const indexFaces = async (};const fetchImageBitmapForContext = async (fileContext: MLSyncFileContext) => {- if (fileContext.imageBitmap) {- return fileContext.imageBitmap;- }+ if (fileContext.imageBitmap) return fileContext.imageBitmap;++ const fileType = fileContext.enteFile.metadata.fileType;if (fileContext.localFile) {- if (fileContext.enteFile.metadata.fileType !== FILE_TYPE.IMAGE) {+ if (fileType !== FILE_TYPE.IMAGE)throw new Error("Local file of only image type is supported");- }+fileContext.imageBitmap = await getLocalFileImageBitmap(fileContext.enteFile,fileContext.localFile,);- } else if (- [FILE_TYPE.IMAGE, FILE_TYPE.LIVE_PHOTO].includes(- fileContext.enteFile.metadata.fileType,- )- ) {+ } else if ([FILE_TYPE.IMAGE, FILE_TYPE.LIVE_PHOTO].includes(fileType)) {fileContext.imageBitmap = await fetchImageBitmap(fileContext.enteFile);} else {- // TODO-ML(MR): We don't do it on videos, when will we ever come- // here?- fileContext.imageBitmap = await getThumbnailImageBitmap(- fileContext.enteFile,- );+ throw new Error(`Cannot index unsupported file type ${fileType}`);}const { width, height } = fileContext.imageBitmap;diff --git a/web/apps/photos/src/services/face/image.ts b/web/apps/photos/src/services/face/image.tsindex 350b375894..09e20b40bd 100644--- a/web/apps/photos/src/services/face/image.ts+++ b/web/apps/photos/src/services/face/image.ts@@ -1,6 +1,5 @@import { FILE_TYPE } from "@/media/file-type";import { decodeLivePhoto } from "@/media/live-photo";-import log from "@/next/log";import { Matrix, inverse } from "ml-matrix";import DownloadManager from "services/download";import { FaceAlignment } from "services/face/types";@@ -36,13 +35,6 @@ async function fetchRenderableBlob(file: EnteFile) {}}-export async function getThumbnailImageBitmap(file: EnteFile) {- const thumb = await DownloadManager.getThumbnail(file);- log.info("[MLService] Got thumbnail: ", file.id.toString());-- return createImageBitmap(new Blob([thumb]));-}-export async function getLocalFileImageBitmap(enteFile: EnteFile,localFile: globalThis.File,