logo

pleroma-fe

My custom branche(s) on git.pleroma.social/pleroma/pleroma-fe git clone https://anongit.hacktivis.me/git/pleroma-fe.git/
commit: 7a4efdb5a8fa749eadee29bc15274f47dbb50572
parent 0a5de96f36928cc940dbc9b0ac0790f0e50c3806
Author: Lain Soykaf <lain@lain.com>
Date:   Tue, 21 Jan 2025 09:24:18 +0400

Settings: Make image compression configurable

Diffstat:

Msrc/components/media_upload/media_upload.js5+++++
Msrc/components/settings_modal/tabs/general_tab.vue8++++++++
Msrc/i18n/en.json1+
Msrc/modules/config.js3++-
4 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/src/components/media_upload/media_upload.js b/src/components/media_upload/media_upload.js @@ -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) diff --git a/src/components/settings_modal/tabs/general_tab.vue b/src/components/settings_modal/tabs/general_tab.vue @@ -243,6 +243,14 @@ <h3>{{ $t('settings.attachments') }}</h3> <li> <BooleanSetting + path="imageCompression" + expert="1" + > + {{ $t('settings.image_compression') }} + </BooleanSetting> + </li> + <li> + <BooleanSetting path="useContainFit" expert="1" > diff --git a/src/i18n/en.json b/src/i18n/en.json @@ -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", diff --git a/src/modules/config.js b/src/modules/config.js @@ -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