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', () => {