From b18af414b6c6714fd1165811b56a7f5793d922f9 Mon Sep 17 00:00:00 2001 From: advplyr Date: Tue, 14 Dec 2021 15:19:23 -0600 Subject: [PATCH] Fix:Check failed ffmpeg image command +additional errors logs #239 --- server/CacheManager.js | 2 ++ server/utils/ffmpegHelpers.js | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/server/CacheManager.js b/server/CacheManager.js index 6fe3d9e2..29ba4cca 100644 --- a/server/CacheManager.js +++ b/server/CacheManager.js @@ -37,6 +37,8 @@ class CacheManager { await fs.ensureDir(this.CoverCachePath) let writtenFile = await resizeImage(audiobook.book.coverFullPath, path, width, height) + if (!writtenFile) return res.sendStatus(400) + var readStream = fs.createReadStream(writtenFile) readStream.pipe(res) } diff --git a/server/utils/ffmpegHelpers.js b/server/utils/ffmpegHelpers.js index 0d92685a..308a1440 100644 --- a/server/utils/ffmpegHelpers.js +++ b/server/utils/ffmpegHelpers.js @@ -107,7 +107,7 @@ async function resizeImage(filePath, outputPath, width, height) { Logger.debug(`[FfmpegHelpers] Resize Image Cmd: ${cmd}`) }) ffmpeg.on('error', (err, stdout, stderr) => { - Logger.error(`[FfmpegHelpers] Resize Image Error ${err}`) + Logger.error(`[FfmpegHelpers] Resize Image Error ${err} ${stdout} ${stderr}`) resolve(false) }) ffmpeg.on('end', () => {