π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
Use preferred casing of Wasm
Manav Rathi18cc16bcc005
diff --git a/desktop/docs/dependencies.md b/desktop/docs/dependencies.mdindex d5d58e772a..3d83b08b00 100644--- a/desktop/docs/dependencies.md+++ b/desktop/docs/dependencies.md@@ -108,7 +108,7 @@ For video conversions and metadata extraction, we use ffmpeg. To bundle a[ffmpeg-static](https://github.com/eugeneware/ffmpeg-static).> There is a significant (~20x) speed difference between using the compiled-> ffmpeg binary and using the wasm one (that our renderer process already has).+> FFmpeg binary and using the Wasm one (that our renderer process already has).> Which is why we bundle it to speed up operations on the desktop app.On Linux and Windows, we use `vips` for thumbnail generation and JPEG conversiondiff --git a/desktop/src/main/services/ffmpeg.ts b/desktop/src/main/services/ffmpeg.tsindex 2ffd37a19b..3b8e1d99f6 100644--- a/desktop/src/main/services/ffmpeg.ts+++ b/desktop/src/main/services/ffmpeg.ts@@ -9,7 +9,7 @@ import {makeTempFilePath,} from "../utils/temp";-/* Ditto in the web app's code (used by the WASM FFmpeg invocation). */+/* Ditto in the web app's code (used by the Wasm FFmpeg invocation). */const ffmpegPathPlaceholder = "FFMPEG";const inputPathPlaceholder = "INPUT";const outputPathPlaceholder = "OUTPUT";@@ -19,7 +19,7 @@ const outputPathPlaceholder = "OUTPUT";** [Note: FFmpeg in Electron]*- * There is a wasm build of FFmpeg, but that is currently 10-20 times slower+ * There is a Wasm build of FFmpeg, but that is currently 10-20 times slower* that the native build. That is slow enough to be unusable for our purposes.* https://ffmpegwasm.netlify.app/docs/performance*diff --git a/desktop/src/main/services/ml.ts b/desktop/src/main/services/ml.tsindex f1e50c565f..d142ad5326 100644--- a/desktop/src/main/services/ml.ts+++ b/desktop/src/main/services/ml.ts@@ -20,7 +20,7 @@ let _child: UtilityProcess | undefined;* [Note: ML IPC]** The primary reason for doing ML tasks in the Node.js layer is so that we can- * use the binary ONNX runtime, which is 10-20x faster than the WASM one that+ * use the binary ONNX runtime, which is 10-20x faster than the Wasm one that* can be used directly on the web layer.** For this to work, the main and renderer process need to communicate with eachdiff --git a/web/apps/photos/src/services/upload/thumbnail.ts b/web/apps/photos/src/services/upload/thumbnail.tsindex ed4f14b740..fd7c81e852 100644--- a/web/apps/photos/src/services/upload/thumbnail.ts+++ b/web/apps/photos/src/services/upload/thumbnail.ts@@ -131,7 +131,7 @@ const generateVideoThumbnailWeb = async (blob: Blob) => {return await ffmpeg.generateVideoThumbnailWeb(blob);} catch (e) {log.error(- `Failed to generate video thumbnail using the wasm FFmpeg web worker, will fallback to canvas`,+ `Failed to generate video thumbnail using the Wasm FFmpeg web worker, will fallback to canvas`,e,);return generateVideoThumbnailUsingCanvas(blob);diff --git a/web/docs/dependencies.md b/web/docs/dependencies.mdindex f0be583b83..660148b1b8 100644--- a/web/docs/dependencies.md+++ b/web/docs/dependencies.md@@ -198,9 +198,9 @@ via [@fontsource-variable/inter](https://fontsource.org/fonts/inter/install).## Media- [ffmpeg.wasm](https://github.com/ffmpegwasm/ffmpeg.wasm) is used to run FFmpeg- in the browser using WASM. Note that this is substantially slower than native- ffmpeg (the desktop app can, and does, bundle the faster native ffmpeg- implementation too).+ in the browser using WebAssembly (Wasm). Note that this is substantially+ slower than native ffmpeg (the desktop app can, and does, bundle the faster+ native ffmpeg implementation too).- [ExifReader](https://github.com/mattiasw/ExifReader) is used for Exif parsing.diff --git a/web/docs/heic.md b/web/docs/heic.mdindex b8da9e5e7f..1f18ad45fd 100644--- a/web/docs/heic.md+++ b/web/docs/heic.md@@ -70,7 +70,7 @@ FFmpeg, as of 2024, partially supports converting HEIC filesborder on the right and bottom (and the orientation is also not respected).FFmpeg support would be nice since we already bundle it both in the desktop app-and also as a web WASM build.+and also as a web Wasm build.---@@ -83,6 +83,6 @@ option to swap libde265 with libx265 or kvazaar.Currently our web app uses[heic-convert](https://github.com/catdad-experiments/heic-convert), which-provides packaged wasm builds of libheif + libde265, and the desktop app uses a+provides packaged Wasm builds of libheif + libde265, and the desktop app uses a[custom build](https://github.com/ente-io/libvips-packaging) of `vips` on Linuxand Windows, and Apple's `sips` on macOS.diff --git a/web/packages/base/types/ipc.ts b/web/packages/base/types/ipc.tsindex da71b967f0..810a244020 100644--- a/web/packages/base/types/ipc.ts+++ b/web/packages/base/types/ipc.ts@@ -309,8 +309,8 @@ export interface Electron {* {@link dataOrPathOrZipItem}.** This executes the command using a FFmpeg executable we bundle with our- * desktop app. We also have a wasm FFmpeg wasm implementation that we use- * when running on the web, which has a sibling function with the same+ * desktop app. We also have a Wasm FFmpeg implementation that we use when+ * running on the web, which has a sibling function with the same* parameters. See [Note:FFmpeg in Electron].** @param command An array of strings, each representing one positionaldiff --git a/web/packages/gallery/services/ffmpeg/index.ts b/web/packages/gallery/services/ffmpeg/index.tsindex 1152a33f5f..2141dfec23 100644--- a/web/packages/gallery/services/ffmpeg/index.ts+++ b/web/packages/gallery/services/ffmpeg/index.ts@@ -20,7 +20,7 @@ import {import { ffmpegExecWeb } from "./web";/**- * Generate a thumbnail for the given video using a wasm FFmpeg running in a web+ * Generate a thumbnail for the given video using a Wasm FFmpeg running in a web* worker.** This function is called during upload, when we need to generate thumbnails@@ -94,7 +94,7 @@ const makeGenThumbnailCommand = (seekTime: number) => [** When we're running in the context of our desktop app _and_ we're passed a* file path , this uses the native FFmpeg bundled with our desktop app.- * Otherwise it uses a wasm build of FFmpeg running in a web worker.+ * Otherwise it uses a Wasm build of FFmpeg running in a web worker.** This function is called during upload, when we need to extract the metadata* of videos that the user is uploading.@@ -270,7 +270,7 @@ const convertToMP4Native = async (electron: Electron, blob: Blob) => {};/**- * Generate a preview variant of for the given video using a wasm FFmpeg running+ * Generate a preview variant of for the given video using a Wasm FFmpeg running* in a web worker.** See: [Note: Preview variant of videos].diff --git a/web/packages/gallery/services/ffmpeg/web.ts b/web/packages/gallery/services/ffmpeg/web.tsindex a52e023d4b..d0bb10ca65 100644--- a/web/packages/gallery/services/ffmpeg/web.ts+++ b/web/packages/gallery/services/ffmpeg/web.ts@@ -30,11 +30,13 @@ const createFFmpeg = async () => {};/**- * Run the given FFmpeg command using a wasm FFmpeg running in a web worker.+ * Run the given FFmpeg command using a Wasm FFmpeg running in a web worker.*- * This is a sibling of {@link ffmpegExec} exposed by the desktop app in `ipc.ts`.- * As a rough ballpark, currently the native FFmpeg integration in the desktop- * app is 10-20x faster than the wasm one. See: [Note: FFmpeg in Electron].+ * This is a sibling of {@link ffmpegExec} exposed by the desktop app in+ * `ipc.ts`. As a rough ballpark, currently the native FFmpeg integration in the+ * desktop app is 10-20x faster than the Wasm one.+ *+ * See: [Note: FFmpeg in Electron].** @param command The FFmpeg command to execute.*diff --git a/web/packages/gallery/utils/convert.ts b/web/packages/gallery/utils/convert.tsindex 67a571f3f5..044c2ef6b3 100644--- a/web/packages/gallery/utils/convert.ts+++ b/web/packages/gallery/utils/convert.ts@@ -29,7 +29,7 @@ import { detectFileTypeInfo } from "./detect-type";* desktop app can natively convert to a JPEG (using ffmpeg), do that and* return the resultant JPEG blob.*- * 4. If this is an HEIC file, use our (WASM) HEIC converter and return the+ * 4. If this is an HEIC file, use our (Wasm) HEIC converter and return the* resultant JPEG blob.** 5. Otherwise return the original (with the MIME type if we were able to@@ -124,7 +124,7 @@ const nativeConvertToJPEG = async (imageBlob: Blob) => {** - Otherwise try to convert using FFmpeg. This conversion always happens on* the desktop app, but in the browser the conversion only happens for short- * videos since the WASM FFmpeg implementation is much slower. There is also a+ * videos since the Wasm FFmpeg implementation is much slower. There is also a* flag to force this conversion regardless.*/export const playableVideoBlob = async (diff --git a/web/packages/media/heic-convert.ts b/web/packages/media/heic-convert.tsindex 62cee7ec52..2715d475a0 100644--- a/web/packages/media/heic-convert.ts+++ b/web/packages/media/heic-convert.ts@@ -4,7 +4,7 @@ import type { HEICConvertWorker } from "./heic-convert.worker";/*** Convert a HEIC image to a JPEG.*- * Behind the scenes, it uses a web worker to do the conversion using a WASM+ * Behind the scenes, it uses a web worker to do the conversion using a Wasm* HEIC conversion package.** @param heicBlob The HEIC blob to convert.diff --git a/web/packages/new/photos/services/ml/math.ts b/web/packages/new/photos/services/ml/math.tsindex afdb18b03a..b4506f0fff 100644--- a/web/packages/new/photos/services/ml/math.ts+++ b/web/packages/new/photos/services/ml/math.ts@@ -46,7 +46,7 @@ export const clamp = (value: number, min: number, max: number) =>** [Note: Dot product performance]*- * In theory, WASM SIMD instructions should give us a huge boost for computing+ * In theory, Wasm SIMD instructions should give us a huge boost for computing* dot products. In practice, we can get to roughly around the same performance* by using Float32Arrays instead of number[], and letting the JS JIT do the* optimizations for us (This assertion was made on Chrome on macOS on Sep 2023,@@ -54,7 +54,7 @@ export const clamp = (value: number, min: number, max: number) =>** We can get a further 2x speedup over this by using some library that directly* uses the SIMD intrinsics provided by the architecture instead of limiting- * itself to WASM's set. But that'll require bundling native code, so as a+ * itself to Wasm's set. But that'll require bundling native code, so as a* tradeoff to avoid complexity we currently leave that 1x on the table.*/export const dotProduct = (v1: Float32Array, v2: Float32Array) => {