From 2568e4cbb4ae009b35d22a74fa3fa837caab5295 Mon Sep 17 00:00:00 2001 From: Manav Rathi Date: Mon, 22 Jul 2024 19:05:41 +0530 Subject: [PATCH] Document the case from user logs [rndr] [error] Native thumbnail generation failed: Error: Error invoking remote method 'ffmpegExec': Error: Command failed: '/Applications/ente.app/Contents/Resources/app.asar.unpacked/node_modules/ffmpeg-static/ffmpeg' -i /var/folders/61/8lm3qh2s1vx9905_jkvgcsqh0000gn/T/ente/9P6wsR5mPA -ss '00:00:00' -vframes 1 -vf 'scale=-1:720' '/var/folders/61/8lm3qh2s1vx9 905_jkvgcsqh0000gn/T/ente/wvkVRFNgpy.jpeg' /bin/sh: /Applications/ente.app/Contents/Resources/app.asar.unpacked/node_modules/ffmpeg-static/ffmpeg: Bad CPU type in executable [rndr] [warn] Not using browser based thumbnail generation fallback for video at path takeout-xxx.zip,Takeout/yyy.mp4 --- .../src/services/upload/uploadService.ts | 26 +++++++++---------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/web/apps/photos/src/services/upload/uploadService.ts b/web/apps/photos/src/services/upload/uploadService.ts index fdfb3657de..53301f4aaa 100644 --- a/web/apps/photos/src/services/upload/uploadService.ts +++ b/web/apps/photos/src/services/upload/uploadService.ts @@ -1037,26 +1037,24 @@ const withThumbnail = async ( } else { // 3. Browser based thumbnail generation for paths. // - // There are two reasons why we could get here: + // We can only get here when we're running in our desktop app (since + // only that works with non-File uploadItems), and the thumbnail + // generation failed. The scenarios are: // - // - We're running under Electron, but thumbnail generation is not - // available. This is currently only a specific scenario for image - // files on Windows. + // 1. We're trying to generate an image thumbnail on Windows or on + // ARM64 Linux. This won't be possible since the bundled + // imagemagick doesn't yet support these OS/arch combinations. // - // - We're running under the Electron, but the thumbnail generation - // otherwise failed for some exception. + // 2. We're trying to generate a video thumbnail on Intel macOS. + // This won't be possible since the bundled ffmpeg doesn't + // support Rosetta. + // + // 3. Some other arbitrary exception happened. // // The fallback in this case involves reading the entire stream into // memory, and passing that data across the IPC boundary in a single // go (i.e. not in a streaming manner). This is risky for videos of - // unbounded sizes, plus we shouldn't even be getting here unless - // something went wrong. - // - // So instead of trying to cater for arbitrary exceptions, we only - // run this fallback to cover for the case where thumbnail - // generation was not available for an image file on Windows. - // If/when we add support of native thumbnailing on Windows too, - // this entire branch can be removed. + // unbounded sizes, so we can only apply this fallback for images. if (fileTypeInfo.fileType == FILE_TYPE.IMAGE) { const data = await readEntireStream(fileStream.stream);