From 272b8f21df2c000b1c6c4579d8579193abb4dbd4 Mon Sep 17 00:00:00 2001 From: anatawa12 Date: Mon, 18 Sep 2023 20:00:44 +0900 Subject: [PATCH] fix(backend): original image is not original image on web page --- packages/backend/src/core/DriveService.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/backend/src/core/DriveService.ts b/packages/backend/src/core/DriveService.ts index a4f6a96a41da..281607512a7f 100644 --- a/packages/backend/src/core/DriveService.ts +++ b/packages/backend/src/core/DriveService.ts @@ -302,12 +302,14 @@ export class DriveService { const metadata = await img.metadata(); isAnimated = !!(metadata.pages && metadata.pages > 1); + // nirila Extension: We want to keep original size as possible + // noinspection PointlessBooleanExpressionJS satisfyWebpublic = !!( type !== 'image/svg+xml' && // security reason - type !== 'image/avif' && // not supported by Mastodon and MS Edge - !(metadata.exif ?? metadata.iptc ?? metadata.xmp ?? metadata.tifftagPhotoshop) && - metadata.width && metadata.width <= 2048 && - metadata.height && metadata.height <= 2048 + type !== 'image/avif' // not supported by Mastodon and MS Edge + //!(metadata.exif ?? metadata.iptc ?? metadata.xmp ?? metadata.tifftagPhotoshop) && + //metadata.width && metadata.width <= 2048 && + //metadata.height && metadata.height <= 2048 ); } catch (err) { this.registerLogger.warn(`sharp failed: ${err}`);