Settings: Make image compression configurable

This commit is contained in:
Lain Soykaf 2025-01-21 09:24:18 +04:00
parent 0a5de96f36
commit 7a4efdb5a8
4 changed files with 16 additions and 1 deletions

View file

@ -34,6 +34,11 @@ const mediaUpload = {
return file
}
// Skip if image compression is disabled
if (!this.$store.getters.mergedConfig.imageCompression) {
return file
}
// For PNGs, check if animated
if (file.type === 'image/png') {
const isAnimated = await this.isAnimatedPng(file)

View file

@ -241,6 +241,14 @@
</li>
</ul>
<h3>{{ $t('settings.attachments') }}</h3>
<li>
<BooleanSetting
path="imageCompression"
expert="1"
>
{{ $t('settings.image_compression') }}
</BooleanSetting>
</li>
<li>
<BooleanSetting
path="useContainFit"

View file

@ -439,6 +439,7 @@
"allow_following_move": "Allow auto-follow when following account moves",
"attachmentRadius": "Attachments",
"attachments": "Attachments",
"image_compression": "Compress images before uploading",
"avatar": "Avatar",
"avatarAltRadius": "Avatars (notifications)",
"avatarRadius": "Avatars",

View file

@ -190,7 +190,8 @@ export const defaultState = {
unsavedPostAction: undefined, // instance default
autoSaveDraft: undefined, // instance default
useAbsoluteTimeFormat: undefined, // instance default
absoluteTimeFormatMinAge: undefined // instance default
absoluteTimeFormatMinAge: undefined, // instance default
imageCompression: true
}
// caching the instance default properties