dsh-attachment-downscale
Manifest validDSH Plugin: Automatic Downgrade of Image Attachments Exceeding Limits (2000px / 3.5MB / 40 Megapixels)
dsh-attachment-downscale
DSH 图片附件准入对超限图片(单边 >2000px / 单图 >3.5MB / 像素超 4000 万)直接拒绝,
上传手机原图时体验很差。本插件在 attachments 服务入口(saveImages)把超限图片
用 sharp 自动降级后再入库:
- 超尺寸 → 等比缩放到限制内(长边 ≤2000px)
- 缩放后仍超字节数 → 同格式降质(jpeg/webp 质量阶梯),仍不行转 webp
- 多帧动图(GIF/WebP)跳过不处理,避免破坏动画
- 处理失败 → 直通原准入逻辑(维持原拒绝行为),绝不吞错误
入库后图片恒满足准入限制,模型请求 / vision-bridge / 历史导出拿到的都是合规文件。
安装
# 本地开发
npm run build # 或 dev_build_plugin
# 装入 web profile(热生效,免重启):
# dev_install_package /Users/zoumutou/coded/dsh-attachment-downscale web
# 生产(npm 发布后)
dsh plugin --profile web add dsh-attachment-downscale
# 或 GitHub 装配
dsh plugin --profile web add github:zoumutou/dsh-attachment-downscale
市场上架
- npm 包带
dsh-plugin关键词,GitHub 仓库打dsh-plugin话题后,社区市场 (dsh-suite 每小时刷新 / chnjames dsh-plugin-market 实时查询)自动收录,无需 PR。 - Release 附件:
npm pack产出dsh-attachment-downscale-<version>.tgz。
配置
插件行支持 config:
- insert:
- name: dsh-attachment-downscale
config:
enabled: true # 关闭后恢复原拒绝行为
quality: 82 # 重编码质量(jpeg/webp)
# 以下缺省跟随 attachments 服务自身的准入限制:
# maxImageDimension: 2000
# maxImageBytes: 3670016
# maxImagePixels: 40000000
测试
node test/normalize.test.mjs
Versions
| Latest version | Published | Size |
|---|---|---|
| 0.1.0 | — | — |
Comments
Loading…
Similar plugins
by uckkk
图片处理:读取尺寸/格式、缩放与格式转换(内置 ffmpeg)
★ 0
MIT
JavaScript
Aug 19, 2026
dsh plugin --profile web add dsh-imageby dsh-plugins
DeepSeek Harness Web plugin: native image previews plus persistent non-image file-drop attachment cards
★ 0
GPL-3.0
JavaScript
Sep 11, 2026
dsh plugin --profile web add dsh-file-drop-attachments-persistedby Tiko9527
DSH high-resolution image tiler: slices large images into <=800x800 tiles before sending to DeepSeek. Highly AI-native, only DeepSeek participation.
★ 0
BSD-3-Clause
TypeScript
Aug 23, 2026
dsh plugin --profile web add @dsh-external/dsh-image-tilerby azwosile
专供 deepseek-v4-flash-vision-exp 的高清识图增强插件:放宽 DSH 图片限制 + highres_read 分块识图工具。
★ 8
MIT
JavaScript
Sep 11, 2026
dsh plugin --profile web add dsh-highres-visionby dami9527
DeepSeek Harness 插件:让 deepseek-v4-flash 等不能看图的模型也能处理聊天图片,内置识图工具。安装:dsh plugin --profile web add dsh-image-pathify
★ 4
↓ 768/wk
MIT
TypeScript
Oct 2, 2026
dsh plugin --profile web add dsh-image-pathifyby meyaomiao
DSH 插件:接近原生质感的附件上传(拖入/粘贴/回形针,图片与文件混排)
★ 3
↓ 128/wk
MIT
TypeScript
Sep 14, 2026
dsh plugin --profile web add dsh-files-native