Skip to content

Commit

Permalink
fix(backend): original image is not original image on web page
Browse files Browse the repository at this point in the history
  • Loading branch information
anatawa12 committed Sep 18, 2023
1 parent 772d453 commit 272b8f2
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions packages/backend/src/core/DriveService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}`);
Expand Down

0 comments on commit 272b8f2

Please sign in to comment.