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

Image compression setting

See merge request pleroma/pleroma-fe!1996
This commit is contained in:
HJ 2025-01-21 08:59:06 +00:00
commit eea173cf7e
5 changed files with 17 additions and 1 deletions

View file

@ -0,0 +1 @@
Added configurable image compression option in general settings, allowing users to control whether images are compressed before upload.

View file

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

View file

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

View file

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

View file

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