From 4ff35ce35225c04405873245d1ff031e1b0af8bf Mon Sep 17 00:00:00 2001 From: tianmo Date: Sat, 19 Sep 2026 09:48:09 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=A8=E6=80=81=E7=BC=A9=E7=95=A5=E5=9B=BE?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- _locales/en.json | 2 +- _locales/zh_CN.json | 2 +- _locales/zh_TW.json | 2 +- release/UNIVERSAL_SpineViewer/_locales/de_DE.json | 2 +- release/UNIVERSAL_SpineViewer/_locales/en.json | 4 ++-- release/UNIVERSAL_SpineViewer/_locales/es_ES.json | 2 +- release/UNIVERSAL_SpineViewer/_locales/ja_JP.json | 2 +- release/UNIVERSAL_SpineViewer/_locales/ko_KR.json | 2 +- release/UNIVERSAL_SpineViewer/_locales/ru_RU.json | 2 +- release/UNIVERSAL_SpineViewer/_locales/zh_CN.json | 4 ++-- release/UNIVERSAL_SpineViewer/_locales/zh_TW.json | 4 ++-- tests/apng-thumbnail.test.js | 6 +++++- 12 files changed, 19 insertions(+), 15 deletions(-) diff --git a/_locales/en.json b/_locales/en.json index 6eb74be..89901aa 100644 --- a/_locales/en.json +++ b/_locales/en.json @@ -21,7 +21,7 @@ "thumbnail": "Set current item thumbnail", "thumbnailTitle": "Set the current frame as this item's 400×400 custom thumbnail", "animatedThumbnailTitle": "Generate animated thumbnail", - "animatedThumbnailNote": "This replaces the current item thumbnail and the plugin cannot restore the previous image. Frame count, color precision and internal detail are reduced automatically to meet the size limit.", + "animatedThumbnailNote": "This replaces the current thumbnail and cannot be undone by the plugin. Frame count, color precision and detail are reduced first; if needed, dimensions are reduced progressively from 400×400.", "animatedRange": "Animation range", "animatedStart": "Start", "animatedEnd": "End", diff --git a/_locales/zh_CN.json b/_locales/zh_CN.json index aad68f1..5d2e985 100644 --- a/_locales/zh_CN.json +++ b/_locales/zh_CN.json @@ -21,7 +21,7 @@ "thumbnail": "设为当前素材缩略图", "thumbnailTitle": "将当前帧设为当前素材的 400×400 自定义缩略图", "animatedThumbnailTitle": "生成动画缩略图", - "animatedThumbnailNote": "生成后将替换当前素材缩略图,插件无法自动恢复原图。将自动降低帧数、颜色精度和内部细节以满足体积上限。", + "animatedThumbnailNote": "生成后将替换当前素材缩略图,插件无法自动恢复原图。将自动降低帧数、颜色精度和内部细节;仍超标时会把尺寸从 400×400 逐级调低。", "animatedRange": "动画范围", "animatedStart": "开始", "animatedEnd": "结束", diff --git a/_locales/zh_TW.json b/_locales/zh_TW.json index c31590c..c96520b 100644 --- a/_locales/zh_TW.json +++ b/_locales/zh_TW.json @@ -21,7 +21,7 @@ "thumbnail": "設為目前素材縮圖", "thumbnailTitle": "將目前影格設為目前素材的 400×400 自訂縮圖", "animatedThumbnailTitle": "產生動畫縮圖", - "animatedThumbnailNote": "產生後會取代目前素材縮圖,外掛無法自動復原原圖。會自動降低影格數、色彩精度和內部細節以符合檔案上限。", + "animatedThumbnailNote": "產生後會取代目前素材縮圖,外掛無法自動復原原圖。會自動降低影格數、色彩精度和內部細節;仍超標時會將尺寸從 400×400 逐級調低。", "animatedRange": "動畫範圍", "animatedStart": "開始", "animatedEnd": "結束", diff --git a/release/UNIVERSAL_SpineViewer/_locales/de_DE.json b/release/UNIVERSAL_SpineViewer/_locales/de_DE.json index 8434ad5..32393f6 100644 --- a/release/UNIVERSAL_SpineViewer/_locales/de_DE.json +++ b/release/UNIVERSAL_SpineViewer/_locales/de_DE.json @@ -38,7 +38,7 @@ "animatedInvalidRange": "Geben Sie einen gültigen ganzzahligen Framebereich zwischen 0 und {duration} ein", "animatedGenerating": "Animiertes Vorschaubild wird erzeugt {current}/{total}…", "animatedTooLarge": "Das animierte Vorschaubild ist größer als 50 MB. Verkürzen Sie den Bereich oder wählen Sie eine niedrigere Qualität.", - "animatedThumbUpdated": "Animiertes Vorschaubild aktualisiert · {frames} Frames · {size} MB", + "animatedThumbUpdated": "Animiertes Vorschaubild aktualisiert · {frames} Frames · {size} KB", "groupThumbnail": "Vorschaubilder für verknüpfte Ressourcen erstellen", "groupThumbnailTitle": "Verknüpfte Spine-Ressourcen prüfen und Vorschaubilder gesammelt erstellen", "groupDialogTitle": "Vorschaubilder für verknüpfte Ressourcen erstellen", diff --git a/release/UNIVERSAL_SpineViewer/_locales/en.json b/release/UNIVERSAL_SpineViewer/_locales/en.json index 3057fb0..89901aa 100644 --- a/release/UNIVERSAL_SpineViewer/_locales/en.json +++ b/release/UNIVERSAL_SpineViewer/_locales/en.json @@ -21,7 +21,7 @@ "thumbnail": "Set current item thumbnail", "thumbnailTitle": "Set the current frame as this item's 400×400 custom thumbnail", "animatedThumbnailTitle": "Generate animated thumbnail", - "animatedThumbnailNote": "This replaces the current item thumbnail and the plugin cannot restore the previous image. Frame count, color precision and internal detail are reduced automatically to meet the size limit.", + "animatedThumbnailNote": "This replaces the current thumbnail and cannot be undone by the plugin. Frame count, color precision and detail are reduced first; if needed, dimensions are reduced progressively from 400×400.", "animatedRange": "Animation range", "animatedStart": "Start", "animatedEnd": "End", @@ -38,7 +38,7 @@ "animatedInvalidRange": "Enter a valid whole-frame range between 0 and {duration}", "animatedGenerating": "Generating animated thumbnail {current}/{total}…", "animatedTooLarge": "The animated thumbnail exceeds 50 MB. Shorten the range or select a lower quality.", - "animatedThumbUpdated": "Animated thumbnail updated · {frames} frames · {size} MB", + "animatedThumbUpdated": "Animated thumbnail updated · {frames} frames · {size} KB", "groupThumbnail": "Generate thumbnails for related assets", "groupThumbnailTitle": "Review related Spine assets, then generate thumbnails in a batch", "groupDialogTitle": "Generate thumbnails for related assets", diff --git a/release/UNIVERSAL_SpineViewer/_locales/es_ES.json b/release/UNIVERSAL_SpineViewer/_locales/es_ES.json index e1ab6dd..bda3d04 100644 --- a/release/UNIVERSAL_SpineViewer/_locales/es_ES.json +++ b/release/UNIVERSAL_SpineViewer/_locales/es_ES.json @@ -38,7 +38,7 @@ "animatedInvalidRange": "Introduce un rango de fotogramas enteros entre 0 y {duration}", "animatedGenerating": "Generando miniatura animada {current}/{total}…", "animatedTooLarge": "La miniatura animada supera los 50 MB. Acorta el rango o elige una calidad inferior.", - "animatedThumbUpdated": "Miniatura animada actualizada · {frames} fotogramas · {size} MB", + "animatedThumbUpdated": "Miniatura animada actualizada · {frames} fotogramas · {size} KB", "groupThumbnail": "Generar miniaturas de recursos relacionados", "groupThumbnailTitle": "Revisar los recursos Spine relacionados y generar miniaturas por lotes", "groupDialogTitle": "Generar miniaturas de recursos relacionados", diff --git a/release/UNIVERSAL_SpineViewer/_locales/ja_JP.json b/release/UNIVERSAL_SpineViewer/_locales/ja_JP.json index c2e8b52..ea53d01 100644 --- a/release/UNIVERSAL_SpineViewer/_locales/ja_JP.json +++ b/release/UNIVERSAL_SpineViewer/_locales/ja_JP.json @@ -38,7 +38,7 @@ "animatedInvalidRange": "0 から {duration} フレームまでの有効な整数フレーム範囲を入力してください", "animatedGenerating": "アニメーションサムネイルを生成中 {current}/{total}…", "animatedTooLarge": "アニメーションサムネイルが 50 MB を超えます。範囲を短くするか、低い品質を選択してください。", - "animatedThumbUpdated": "アニメーションサムネイルを更新 · {frames} フレーム · {size} MB", + "animatedThumbUpdated": "アニメーションサムネイルを更新 · {frames} フレーム · {size} KB", "groupThumbnail": "関連アセットのサムネイルを生成", "groupThumbnailTitle": "関連する Spine アセットを確認して一括生成", "groupDialogTitle": "関連アセットのサムネイルを生成", diff --git a/release/UNIVERSAL_SpineViewer/_locales/ko_KR.json b/release/UNIVERSAL_SpineViewer/_locales/ko_KR.json index ea3d774..f487723 100644 --- a/release/UNIVERSAL_SpineViewer/_locales/ko_KR.json +++ b/release/UNIVERSAL_SpineViewer/_locales/ko_KR.json @@ -38,7 +38,7 @@ "animatedInvalidRange": "0에서 {duration}프레임 사이의 올바른 정수 프레임 범위를 입력하세요", "animatedGenerating": "애니메이션 썸네일 생성 중 {current}/{total}…", "animatedTooLarge": "애니메이션 썸네일이 50MB를 초과합니다. 범위를 줄이거나 더 낮은 품질을 선택하세요.", - "animatedThumbUpdated": "애니메이션 썸네일 업데이트 · {frames}프레임 · {size}MB", + "animatedThumbUpdated": "애니메이션 썸네일 업데이트 · {frames}프레임 · {size}KB", "groupThumbnail": "관련 자산 썸네일 생성", "groupThumbnailTitle": "관련 Spine 자산을 확인한 후 일괄 생성", "groupDialogTitle": "관련 자산 썸네일 생성", diff --git a/release/UNIVERSAL_SpineViewer/_locales/ru_RU.json b/release/UNIVERSAL_SpineViewer/_locales/ru_RU.json index 16b9e5f..1e7dcad 100644 --- a/release/UNIVERSAL_SpineViewer/_locales/ru_RU.json +++ b/release/UNIVERSAL_SpineViewer/_locales/ru_RU.json @@ -38,7 +38,7 @@ "animatedInvalidRange": "Введите целый диапазон кадров от 0 до {duration}", "animatedGenerating": "Создание анимированной миниатюры {current}/{total}…", "animatedTooLarge": "Миниатюра превышает 50 МБ. Сократите диапазон или выберите более низкое качество.", - "animatedThumbUpdated": "Миниатюра обновлена · {frames} кадров · {size} МБ", + "animatedThumbUpdated": "Миниатюра обновлена · {frames} кадров · {size} КБ", "groupThumbnail": "Создать миниатюры для связанных ресурсов", "groupThumbnailTitle": "Проверить связанные ресурсы Spine и создать миниатюры", "groupDialogTitle": "Создать миниатюры для связанных ресурсов", diff --git a/release/UNIVERSAL_SpineViewer/_locales/zh_CN.json b/release/UNIVERSAL_SpineViewer/_locales/zh_CN.json index 12e3253..5d2e985 100644 --- a/release/UNIVERSAL_SpineViewer/_locales/zh_CN.json +++ b/release/UNIVERSAL_SpineViewer/_locales/zh_CN.json @@ -21,7 +21,7 @@ "thumbnail": "设为当前素材缩略图", "thumbnailTitle": "将当前帧设为当前素材的 400×400 自定义缩略图", "animatedThumbnailTitle": "生成动画缩略图", - "animatedThumbnailNote": "生成后将替换当前素材缩略图,插件无法自动恢复原图。将自动降低帧数、颜色精度和内部细节以满足体积上限。", + "animatedThumbnailNote": "生成后将替换当前素材缩略图,插件无法自动恢复原图。将自动降低帧数、颜色精度和内部细节;仍超标时会把尺寸从 400×400 逐级调低。", "animatedRange": "动画范围", "animatedStart": "开始", "animatedEnd": "结束", @@ -38,7 +38,7 @@ "animatedInvalidRange": "请输入 0 到 {duration} 帧之间的有效整数帧范围", "animatedGenerating": "正在生成动画缩略图 {current}/{total}…", "animatedTooLarge": "动画缩略图超过 50 MB,请缩短范围或选择更低质量", - "animatedThumbUpdated": "动画缩略图已更新 · {frames} 帧 · {size} MB", + "animatedThumbUpdated": "动画缩略图已更新 · {frames} 帧 · {size} KB", "groupThumbnail": "为关联资源生成缩略图", "groupThumbnailTitle": "列出当前 Spine 关联资源,确认后批量生成缩略图", "groupDialogTitle": "为关联资源生成缩略图", diff --git a/release/UNIVERSAL_SpineViewer/_locales/zh_TW.json b/release/UNIVERSAL_SpineViewer/_locales/zh_TW.json index 26d15ae..c96520b 100644 --- a/release/UNIVERSAL_SpineViewer/_locales/zh_TW.json +++ b/release/UNIVERSAL_SpineViewer/_locales/zh_TW.json @@ -21,7 +21,7 @@ "thumbnail": "設為目前素材縮圖", "thumbnailTitle": "將目前影格設為目前素材的 400×400 自訂縮圖", "animatedThumbnailTitle": "產生動畫縮圖", - "animatedThumbnailNote": "產生後會取代目前素材縮圖,外掛無法自動復原原圖。會自動降低影格數、色彩精度和內部細節以符合檔案上限。", + "animatedThumbnailNote": "產生後會取代目前素材縮圖,外掛無法自動復原原圖。會自動降低影格數、色彩精度和內部細節;仍超標時會將尺寸從 400×400 逐級調低。", "animatedRange": "動畫範圍", "animatedStart": "開始", "animatedEnd": "結束", @@ -38,7 +38,7 @@ "animatedInvalidRange": "請輸入 0 到 {duration} 影格之間的有效整數影格範圍", "animatedGenerating": "正在產生動畫縮圖 {current}/{total}…", "animatedTooLarge": "動畫縮圖超過 50 MB,請縮短範圍或選擇較低品質", - "animatedThumbUpdated": "動畫縮圖已更新 · {frames} 影格 · {size} MB", + "animatedThumbUpdated": "動畫縮圖已更新 · {frames} 影格 · {size} KB", "groupThumbnail": "為關聯資源產生縮圖", "groupThumbnailTitle": "列出目前 Spine 關聯資源,確認後批次產生縮圖", "groupDialogTitle": "為關聯資源產生縮圖", diff --git a/tests/apng-thumbnail.test.js b/tests/apng-thumbnail.test.js index 57f0e2e..0830055 100644 --- a/tests/apng-thumbnail.test.js +++ b/tests/apng-thumbnail.test.js @@ -49,6 +49,10 @@ for (const root of ['.', 'release/UNIVERSAL_SpineViewer']) { assert.match(script, /const targetBytes = maxKilobytes \* 1024/); assert.match(script, /if \(buffer\.length <= targetBytes\) return/); assert.match(script, /count: 2, bits: 3, block: 12/); + assert.match(script, /count: 2, bits: 2, block: 1, size: 32/); + assert.match(script, /const outputSize = profile\.size \|\| size/); + assert.match(script, /return smallest;/); + assert.doesNotMatch(script, /throw new Error\(t\('viewer\.animatedCannotFit'/); assert.match(script, /extension: '\.png'/); assert.match(script, /const totalFrames = Math\.max\(1, frameOf\(animationLength\)\)/); assert.match(script, /start: startFrame \/ FPS/); @@ -61,4 +65,4 @@ for (const root of ['.', 'release/UNIVERSAL_SpineViewer']) { assert.match(html, /id="animatedThumbDialog"/); } -console.log('PASS: APNG structure, fixed 400x400 output, quality profiles and right-click wiring'); +console.log('PASS: APNG structure, 400px maximum with size fallback, byte limit and right-click wiring');