Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(backend): original image is not original image on web page #59

Merged
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) &&
anatawa12 marked this conversation as resolved.
Show resolved Hide resolved
//metadata.width && metadata.width <= 2048 &&
//metadata.height && metadata.height <= 2048
);
} catch (err) {
this.registerLogger.warn(`sharp failed: ${err}`);
Expand Down
Loading