Merge remote-tracking branch 'origin/develop' into migrate/vuex-to-pinia

This commit is contained in:
Henry Jameson 2025-02-03 17:46:41 +02:00
commit 6dfb213dfe
12 changed files with 814 additions and 516 deletions

View file

@ -76,9 +76,9 @@ const mediaUpload = {
const testCanvas = document.createElement('canvas')
const supportsWebP = testCanvas.toDataURL('image/webp').startsWith('data:image/webp')
// Convert to WebP if supported, otherwise JPEG
const type = supportsWebP ? 'image/webp' : 'image/jpeg'
const extension = supportsWebP ? '.webp' : '.jpg'
// Convert to WebP if supported and alwaysUseJpeg is false, otherwise JPEG
const type = (!this.$store.getters.mergedConfig.alwaysUseJpeg && supportsWebP) ? 'image/webp' : 'image/jpeg'
const extension = type === 'image/webp' ? '.webp' : '.jpg'
// Remove the original extension and add new one
const newFileName = file.name.replace(/\.[^/.]+$/, '') + extension

View file

@ -269,6 +269,14 @@
{{ $t('settings.image_compression') }}
</BooleanSetting>
</li>
<li>
<BooleanSetting
path="alwaysUseJpeg"
expert="1"
>
{{ $t('settings.always_use_jpeg') }}
</BooleanSetting>
</li>
<li>
<BooleanSetting
path="useContainFit"

View file

@ -440,6 +440,7 @@
"attachmentRadius": "Attachments",
"attachments": "Attachments",
"image_compression": "Compress images before uploading",
"always_use_jpeg": "Always convert images to JPEG format",
"avatar": "Avatar",
"avatarAltRadius": "Avatars (notifications)",
"avatarRadius": "Avatars",

View file

@ -36,8 +36,6 @@ export const multiChoiceProperties = [
'unsavedPostAction' // save | discard | confirm
]
console.log('TEST', defaultState)
// caching the instance default properties
export const instanceDefaultProperties = Object.entries(defaultState)
.filter(([key, value]) => value === undefined)

View file

@ -160,5 +160,6 @@ export const defaultState = {
useAbsoluteTimeFormat: undefined, // instance default
absoluteTimeFormatMinAge: undefined, // instance default
absoluteTime12h: undefined, // instance default
imageCompression: true
imageCompression: true,
alwaysUseJpeg: false
}

View file

@ -125,6 +125,7 @@ export const _getRecentData = (cache, live, isTest) => {
}
const merge = (a, b) => ({
_user: a._user ?? b._user,
_version: a._version ?? b._version,
_timestamp: a._timestamp ?? b._timestamp,
needUpload: b.needUpload ?? a.needUpload,