Back to home@cyanfish-x

dsh-picture-fit

DSH plugin + Agent Skill: auto-fit oversized images with sharp before attachment admission

Stars
0
Language
JavaScript
Created
Aug 21, 2026
Updated
Aug 21, 2026
GitHub repo

Introduction

dsh-picture-fit

中文 | English

dsh图片大小自动压缩预处理插件,解决dsh聊天框携带过大图片时,调用 deepseek-v4-flash-vision-exp 模型报错的问题;

粘贴 / 拖拽 / 选文件插入图片时,插件会把超限大图自动缩边压缩,避免「图片宽高不能超过 2000px」被拒。同仓附带跨 Agent 的 Skill(Codex / Claude Code / Cursor 等)。

问题描述

粘贴超限大图时,dsh会直接拒绝:

图片宽高不能超过 2000px

  • DSH 默认拒绝单边 >2000px 的图。
  • DeepSeek Vision 官方单边上限更高(8192 / 多图时 4096),见 图像理解 · 限制
  • 宿主选择拒绝而非自动缩图;本插件补上自动 fit。

安装(DSH Web)

提示词安装(推荐)

把下面整段复制发给任意 Agent,让它代为安装:

请帮我安装 DSH 插件 dsh-picture-fit(超限图片自动缩边压缩):

1. 确认本机已安装 dsh CLI,且能执行 `dsh --help`
2. 执行:dsh plugin --profile web add github:cyanfish-x/dsh-picture-fit
3. 安装成功后提醒我重启 dsh web(或帮我重启,若你能操作该进程)
4. 安装完成后说明:设置 → 图片压缩 可开关与覆盖最大边长

仓库:https://github.com/cyanfish-x/dsh-picture-fit

命令行安装

dsh plugin --profile web add github:cyanfish-x/dsh-picture-fit

重启 dsh web

设置

入口:设置 → 图片压缩

图片压缩设置页

配置默认说明
enabledtrue超限时自动缩边
maxDimensionnull(跟宿主)覆盖最大边长;宿主常见为 2000

enabled: false 时与官方拒绝超限图行为一致。只存缩后图;不碰 MCP / 其他插件自管图。

Agent Skill

skill/SKILL.md。仓库内:

npm install
node skill/scripts/fit.mjs ./big.png ./big.fit.png --max 2000

许可

MIT。依赖 sharp(Apache-2.0)。