feat avatar compress uploads to 20kb

This commit is contained in:
IanShaw027
2026-04-21 08:53:59 +08:00
parent 07f23aaa7d
commit 6da08262d7
8 changed files with 321 additions and 44 deletions

View File

@@ -943,15 +943,19 @@ export default {
},
avatar: {
title: 'Profile Avatar',
description: 'Set your avatar with a remote image URL or upload a small image.',
description: 'Set your avatar with a remote image URL or upload an image under 100KB. Uploaded images are compressed to 20KB.',
inputLabel: 'Avatar URL or data URL',
inputPlaceholder: 'https://cdn.example.com/avatar.png',
uploadAction: 'Upload image',
uploadHint: 'Images must be 100KB or smaller',
uploadHint: 'Uploaded images must be 100KB or smaller. Static images are compressed to 20KB.',
saveSuccess: 'Avatar updated',
deleteSuccess: 'Avatar removed',
invalidType: 'Please choose an image file',
fileTooLarge: 'Avatar image must be 100KB or smaller',
gifTooLarge: 'GIF avatars must already be 20KB or smaller',
compressTooLarge: 'Unable to compress this image below 20KB. Try a smaller image.',
compressFailed: 'Failed to compress the selected image.',
readFailed: 'Failed to read the selected image.',
invalidValue: 'Enter a valid avatar URL or image data URL',
emptyDeleteHint: 'Avatar is already empty',
},

View File

@@ -947,15 +947,19 @@ export default {
},
avatar: {
title: '资料头像',
description: '支持填写远程图片 URL或上传不超过 100KB 的头像图片。',
description: '支持填写远程图片 URL或上传不超过 100KB 的头像图片;上传图片会自动压缩到 20KB 以内。',
inputLabel: '头像 URL 或 data URL',
inputPlaceholder: 'https://cdn.example.com/avatar.png',
uploadAction: '上传图片',
uploadHint: '图片大小需不超过 100KB',
uploadHint: '上传图片需不超过 100KB,静态图片会自动压缩到 20KB 以内',
saveSuccess: '头像已更新',
deleteSuccess: '头像已删除',
invalidType: '请选择图片文件',
fileTooLarge: '头像图片必须不超过 100KB',
gifTooLarge: 'GIF 头像必须在 20KB 以内',
compressTooLarge: '无法将图片压缩到 20KB 以内,请换一张更小的图片',
compressFailed: '压缩所选图片失败',
readFailed: '读取所选图片失败',
invalidValue: '请输入有效的头像 URL 或图片 data URL',
emptyDeleteHint: '当前没有可删除的头像',
},