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: eea173cf7e0651bedda62aac5ba6d77cbbf0ef1e
parent 0a5de96f36928cc940dbc9b0ac0790f0e50c3806
Author: HJ <30-hj@users.noreply.git.pleroma.social>
Date:   Tue, 21 Jan 2025 08:59:06 +0000

Merge branch 'image-compression-setting' into 'develop'

Image compression setting

See merge request pleroma/pleroma-fe!1996

Diffstat:

Achangelog.d/image-compression.add2++
Msrc/components/media_upload/media_upload.js5+++++
Msrc/components/settings_modal/tabs/general_tab.vue8++++++++
Msrc/i18n/en.json1+
Msrc/modules/config.js3++-
5 files changed, 18 insertions(+), 1 deletion(-)

diff --git a/changelog.d/image-compression.add b/changelog.d/image-compression.add @@ -0,0 +1 @@ +Added configurable image compression option in general settings, allowing users to control whether images are compressed before upload. +\ No newline at end of file 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