diff --git a/packages/backend/src/logger.ts b/packages/backend/src/logger.ts index e7d7051630..5d275bc7b2 100644 --- a/packages/backend/src/logger.ts +++ b/packages/backend/src/logger.ts @@ -68,6 +68,7 @@ export default class Logger { if (envOption.withLogTime) log = chalk.gray(time) + ' ' + log; console.log(important ? chalk.bold(log) : log); + if (level === 'error' && data) console.log(data); if (store) { if (this.syslogClient) { diff --git a/packages/backend/src/server/FileServerService.ts b/packages/backend/src/server/FileServerService.ts index d6fac44509..56da144b49 100644 --- a/packages/backend/src/server/FileServerService.ts +++ b/packages/backend/src/server/FileServerService.ts @@ -126,7 +126,11 @@ export class FileServerService { const convertFile = async () => { if (isThumbnail) { if (['image/jpeg', 'image/webp', 'image/avif', 'image/png', 'image/svg+xml'].includes(mime)) { - return this.imageProcessingService.convertSharpToWebpStreamObj(Readable.fromWeb(response.body).pipe(sharp()), 498, 280); + return this.imageProcessingService.convertSharpToWebpStreamObj( + Readable.fromWeb(response.body).pipe(sharp()), + 498, + 280 + ); } else if (mime.startsWith('video/')) { await fileSaving; return await this.videoProcessingService.generateVideoThumbnail(path); @@ -136,7 +140,12 @@ export class FileServerService { if (isWebpublic) { if (['image/svg+xml'].includes(mime)) { return { - data: this.imageProcessingService.convertSharpToWebpStream(Readable.fromWeb(response.body).pipe(sharp()), 2048, 2048, { ...webpDefault, lossless: true }), + data: this.imageProcessingService.convertSharpToWebpStream( + Readable.fromWeb(response.body).pipe(sharp()), + 2048, + 2048, + { ...webpDefault, lossless: true } + ), ext: 'webp', type: 'image/webp', }; diff --git a/packages/backend/src/server/MediaProxyServerService.ts b/packages/backend/src/server/MediaProxyServerService.ts index 731486ac23..4ea44c0cbf 100644 --- a/packages/backend/src/server/MediaProxyServerService.ts +++ b/packages/backend/src/server/MediaProxyServerService.ts @@ -108,6 +108,12 @@ export class MediaProxyServerService { withoutEnlargement: true, }) .webp(webpDefault), + err => { + if (err) { + this.logger.error('Sharp pipeline error (emoji)', err); + throw new StatusError('Internal Error occured (in emoji pipeline, MediaProxy)', 500, 'Internal Error occured'); + } + } ); image = {