fix: handle non-image modalities across uploads, previews, and filenames (#255)

SnapOtter spans five modalities now, but several code paths still assumed image input.

- dropzone: default to accept-all when no fileFilter is given (image tools still pass one); neutral "supported file types" error text instead of "image files"
- automate (pipelines): accept any modality in the file pickers and dropzones; render modality-aware previews (video player, audio waveform, document/data card) instead of always using ImageViewer/BeforeAfterSlider
- filename sanitizer: extend the double-extension allowlist beyond image extensions to video/audio/document/data so e.g. "report.csv.php" becomes "report.csv"; add tests
- thumbnail route: return 422 for non-rasterisable files (audio, data, non-PDF docs) instead of attempting a doomed Sharp decode
- pool: unknown tools fall back to the "system" pool, not the image pool
- a11y labels: "Previous/Next image", "Image viewer/area/controls/drop zone" are now modality-neutral, across all 21 locales
- copy: bulk-rename default, find-duplicates ZIP name, SSRF user-agent, fetch-urls fallback name, file-details MIME label, URL-import placeholder, help dialog
This commit is contained in:
SnapOtter
2026-06-16 18:04:48 +08:00
committed by GitHub
parent 622c9f98a5
commit 8eee17aeea
29 changed files with 420 additions and 246 deletions
+12 -12
View File
@@ -2378,13 +2378,13 @@ export const zhCN: TranslationKeys = {
cannotPreviewDownload: "{type} 文件无法在浏览器中预览。请使用下载按钮保存文件。",
generatingPreview: "正在生成预览...",
cannotPreviewWillProcess: "{ext} 文件无法在浏览器中预览。该工具仍会正常处理此文件。",
previousImage: "上一张图片",
nextImage: "下一张图片",
previousImage: "上一个文件",
nextImage: "下一个文件",
imageCounter: "{current} / {total}",
settingsLabel: "设置",
downloadAllZip: "全部下载(ZIP",
hideSettings: "隐藏设置",
imageArea: "图片区域",
imageArea: "预览区域",
disabledByAdmin: "This tool has been disabled by your administrator",
browseOtherTools: "Browse other tools",
privacyNote: "Files are processed on your server and never leave your network",
@@ -3115,10 +3115,10 @@ export const zhCN: TranslationKeys = {
savingIndicator: "...",
cancelButton: "取消",
preview: "预览",
previousImage: "上一张图片",
nextImage: "下一张图片",
previousImage: "上一个文件",
nextImage: "下一个文件",
imageCounter: "{current} / {total}",
imageArea: "图片区域",
imageArea: "预览区域",
templateSocialMedia: "社交媒体适配",
templatePrivacyClean: "隐私清理",
templateWebOptimization: "网页优化",
@@ -3337,14 +3337,14 @@ export const zhCN: TranslationKeys = {
zoomOut: "Zoom out",
fitToView: "Fit to view",
actualSize: "Actual size",
previousImage: "Previous image",
nextImage: "Next image",
imageArea: "Image area",
imageViewer: "Image viewer",
previousImage: "上一个文件",
nextImage: "下一个文件",
imageArea: "预览区域",
imageViewer: "文件查看器",
fileDropZone: "File drop zone",
imageDropZone: "Image drop zone",
imageDropZone: "文件拖放区域",
beforeAfterSlider: "Before/after comparison slider",
imageControls: "Image controls",
imageControls: "预览控件",
zoomControls: "Zoom controls",
dragToReorder: "Drag to reorder",
whiteBackground: "White background",