feat(thumb): support output webp thumbnails for vips generator (#2657)

This commit is contained in:
Aaron Liu 2025-07-15 13:51:22 +08:00
parent e47a708f72
commit a827cc60f2
5 changed files with 13 additions and 11 deletions

View File

@ -440,9 +440,9 @@
"thumbSuffix": "Blob file suffix",
"thumbSuffixDes": "The suffix appended to the original Blob file name for the generated thumbnail, ",
"thumbFormat": "Image format",
"thumbFormatDes": "Available: png/jpg",
"thumbFormatDes": "Preferred image format, if the generator does not support it, it will automatically downgrade to jpg format.",
"thumbQuality": "Quality",
"thumbQualityDes": "Compression quality percentage, valid only for jpg encoding. ",
"thumbQualityDes": "Compression quality percentage, valid only for jpg and webp encoding. ",
"thumbGC": "Run GC after thumb generated",
"captcha": "Captcha",
"captchaType": "Captcha type",

View File

@ -438,9 +438,9 @@
"thumbSuffix": "Blobファイル拡張子",
"thumbSuffixDes": "生成されたサムネイルBlobは、元のBlobに追加されたサフィックスです。",
"thumbFormat": "サムネイル形式",
"thumbFormatDes": "オプションpng/jpg",
"thumbFormatDes": "優先使用するサムネイル形式。ジェネレーターがサポートしていない場合、jpg 形式に自動的に降格します。",
"thumbQuality": "画像品質",
"thumbQualityDes": "圧縮品質パーセンテージ。jpgエンコーディングのみに有効です。",
"thumbQualityDes": "圧縮品質パーセンテージ。jpgとwebpエンコーディングのみに有効です。",
"thumbGC": "生成完了後にメモリを即時解放",
"captcha": "CAPTCHA",
"captchaType": "CAPTCHAの種類",

View File

@ -437,9 +437,9 @@
"thumbSuffix": "Blob 文件后缀",
"thumbSuffixDes": "生成的缩略图 Blob 相对于原始 Blob 增加的后缀,",
"thumbFormat": "缩略图格式",
"thumbFormatDes": "可选png/jpg",
"thumbFormatDes": "优先使用的缩略图格式,如果生成器不支持,会自动降级为 jpg 格式。",
"thumbQuality": "图像质量",
"thumbQualityDes": "压缩质量百分比,只针对 jpg 编码有效。",
"thumbQualityDes": "压缩质量百分比,只针对 jpg 和 webp 编码有效。",
"thumbGC": "生成完成后立即回收内存",
"captcha": "验证码",
"captchaType": "验证码类型",

View File

@ -434,9 +434,9 @@
"thumbSuffix": "Blob 檔案字尾",
"thumbSuffixDes": "生成的縮圖 Blob 相對於原始 Blob 增加的字尾,",
"thumbFormat": "縮圖格式",
"thumbFormatDes": "可選png/jpg",
"thumbFormatDes": "優先使用的縮圖格式,如果生成器不支援,會自動降級為 jpg 格式。",
"thumbQuality": "影象質量",
"thumbQualityDes": "壓縮質量百分比,只針對 jpg 編碼有效。",
"thumbQualityDes": "壓縮質量百分比,只針對 jpg 和 webp 編碼有效。",
"thumbGC": "生成完成後立即回收記憶體",
"captcha": "驗證碼",
"captchaType": "驗證碼型別",

View File

@ -85,7 +85,7 @@ const Media = () => {
}}
required
>
{["jpg", "png"].map((f) => (
{["jpg", "png", "webp"].map((f) => (
<SquareMenuItem value={f} key={f}>
<ListItemText
slotProps={{
@ -97,10 +97,12 @@ const Media = () => {
</SquareMenuItem>
))}
</DenseSelect>
<NoMarginHelperText>{t("settings.notAppliedToNativeGenerator", { prefix: "" })}</NoMarginHelperText>
<NoMarginHelperText>
{t("settings.notAppliedToNativeGenerator", { prefix: t("settings.thumbFormatDes") })}
</NoMarginHelperText>
</FormControl>
</SettingForm>
<Collapse in={values.thumb_encode_method == "jpg"} unmountOnExit>
<Collapse in={values.thumb_encode_method == "jpg" || values.thumb_encode_method == "webp"} unmountOnExit>
<SettingForm title={t("settings.thumbQuality")} lgWidth={5}>
<FormControl>
<DenseFilledTextField