← 返回 Skills 市场
yunkai

Long Image Slicer

作者 yunkai · GitHub ↗ · v1.0.1 · MIT-0
cross-platform ⚠ suspicious
225
总下载
0
收藏
0
当前安装
2
版本数
在 OpenClaw 中安装
/install long-image-slicer
功能描述
智能长截图切片工具。将超长图片(如聊天记录、长截图)按 9:16 比例智能切片,确保文字/拼音不被分割,输出 PDF/ZIP/切片图片。使用场景:用户发送长截图要求切片、分割、转 PDF 等。
使用说明 (SKILL.md)

Long Image Slicer - 长截图智能切片

触发条件

当用户提出以下需求时触发此技能:

  • 长截图切片/分割
  • 聊天记录转 PDF
  • 超长图片处理
  • 确保文字不被截断的切片

工作流程

1. 获取源图片

方式 A:用户直接发送

  • 保存到临时目录

方式 B:用户提供 URL

curl -L "\x3C图片 URL>" -o /tmp/source.jpg

方式 C:用户指定本地路径

  • 直接使用用户提供的路径

2. 执行切片

cd ~/.openclaw/skills/long-image-slicer
python3 scripts/slice_processor.py \x3C源图片路径> [输出目录]

脚本自动:

  1. 分析图片内容密度(检测文字行)
  2. 智能计算切分位置(确保文字/拼音完整)
  3. 生成切片图片(slice_01.jpg ~ slice_48.jpg)
  4. 保存到 输出目录/slices_v7/

3. 生成 PDF

python3 scripts/create_pdf.py \x3C切片目录> [输出 PDF 路径]

PDF 规格:

  • A4 大小 (21.0cm × 29.7cm)
  • 按高度缩放,确保所有切片完整显示
  • 左右边距自动计算(相等)
  • 上下边距 1cm
  • 每页一张切片,垂直居中
  • 页码:右下角(距右边缘 1cm,距下边缘 0.5cm)

4. 交付结果

输出文件:

  • 输出目录/slices_v7/ - 切片图片目录
  • 输出目录/slices_v7.pdf - A4 PDF 文档

脚本说明

scripts/slice_processor.py

核心算法 v7 - 精细平衡版

  • 目标切片高度:1388 像素(按 9:16 比例)
  • 搜索范围:±250 像素
  • 综合评分:间隙大小 (50 分) + 距离 (30 分) + 高度合理性 (20 分)
  • 确保 81% 切片在 1300-1400 像素范围内

依赖

pip3 install Pillow numpy python-docx

scripts/create_pdf.py

PDF 生成器 v5

  • 使用 reportlab 库
  • 按高度缩放,确保所有切片完整显示
  • 左右边距自动计算(相等)
  • 右下角页码

依赖

pip3 install reportlab

示例对话

用户:这张长截图帮我切片,文字不要截断

助手:收到,使用长截图切片工具:

  1. 分析文字行位置
  2. 智能切分(确保拼音完整)
  3. 生成 48 个切片 + PDF

用户:把聊天记录转 PDF,A4 打印

助手:可以,生成长截图 PDF:

  • A4 尺寸,所有切片完整显示
  • 右下角页码

版本历史

  • v7: 精细平衡版,81% 切片在目标范围
  • PDF v5: 高度优先,左右边距相等,页码右下角
安全使用建议
This skill appears to do what it claims (slice long images and produce PDF/ZIP/Word outputs). Before installing or running it: 1) Note that the source is 'unknown'—if you don't trust the author, review the two Python files locally. 2) The scripts will write files to your home directory by default (~/openclaw/workspace/temp/slice-task); change the output path if you prefer. 3) The SKILL.md recommends pip installs (Pillow, numpy, python-docx, reportlab); install these in a virtualenv to avoid system-wide changes. 4) When providing a remote image URL, the curl command will download it to /tmp — only provide URLs you trust. 5) Minor inconsistencies exist (different default paths and slight mismatch between textual margin description and create_pdf.py constants) but these are implementation quirks, not indicators of malicious behavior. If you want higher assurance, run the scripts on a non-sensitive test image in an isolated environment and inspect generated outputs.
功能分析
Type: OpenClaw Skill Name: long-image-slicer Version: 1.0.1 The skill provides legitimate image processing functionality but is classified as suspicious due to its reliance on shell commands (e.g., 'curl' for fetching remote images) and broad file system access within the user's home directory (~/openclaw/workspace). While these capabilities are plausibly needed for the stated purpose of slicing long images and generating PDFs, they represent a significant attack surface for potential shell injection or unauthorized file access if the AI agent does not strictly sanitize user-provided URLs or paths. The core logic in 'scripts/slice_processor.py' and 'scripts/create_pdf.py' appears to be a standard implementation using Pillow, numpy, and reportlab without evidence of intentional malice.
能力评估
Purpose & Capability
Name/description, SKILL.md, and the two Python scripts all align: they analyze long images, compute slice positions, write slice JPGs, and generate PDF/Word/ZIP outputs. Declared dependencies (Pillow, numpy, python-docx, reportlab) are appropriate for image processing and document generation. No unrelated binaries, env vars, or credentials are requested.
Instruction Scope
Runtime instructions are limited to obtaining the source image (user upload, URL download via curl, or local path), running the included Python scripts, and producing local outputs. Scripts read the provided image and write results to disk (default: ~/openclaw/workspace/temp/slice-task). They do not contact external endpoints or read unrelated system files. Minor scope inconsistencies: SKILL.md suggests the skill directory is ~/.openclaw/skills/long-image-slicer while the script default workspace is ~/openclaw/workspace (missing dot) — this only affects where outputs are saved.
Install Mechanism
There is no automatic install step; the skill is instruction-only with bundled scripts. Dependencies are listed as pip packages in SKILL.md; no downloads from unknown URLs or archive extraction steps are present in the package. Users will need to run pip install manually (or the agent may do so), which is expected for Python-based skills.
Credentials
The skill requests no environment variables or credentials. It uses the current user's home directory (os.path.expanduser('~')) to construct a default workspace path; this is reasonable for storing outputs but is worth noting so users know where files will be written. No secret access or unrelated service credentials are requested.
Persistence & Privilege
The skill does not request permanent/always-on presence and does not modify other skills or global agent settings. It writes files to a per-task directory in the user's home; that is normal for a file-processing tool.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install long-image-slicer
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /long-image-slicer 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.1
修复安全问题:移除硬编码绝对路径,改用命令行参数和相对路径
v1.0.0
Initial release of long-image-slicer: - Added intelligent slicing for long images (e.g., chat logs), preserving text/pinyin integrity. - Supports image input via user upload, URL, or local path. - Outputs individual slices (9:16 ratio), downloadable as images, ZIP, or A4-sized PDF. - Ensures auto-calculated margins, vertical centering, and page numbers in PDF export. - Includes robust text-line detection and refined slicing algorithm.
元数据
Slug long-image-slicer
版本 1.0.1
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 2
常见问题

Long Image Slicer 是什么?

智能长截图切片工具。将超长图片(如聊天记录、长截图)按 9:16 比例智能切片,确保文字/拼音不被分割,输出 PDF/ZIP/切片图片。使用场景:用户发送长截图要求切片、分割、转 PDF 等。 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 225 次。

如何安装 Long Image Slicer?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install long-image-slicer」即可一键安装,无需额外配置。

Long Image Slicer 是免费的吗?

是的,Long Image Slicer 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Long Image Slicer 支持哪些平台?

Long Image Slicer 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Long Image Slicer?

由 yunkai(@yunkai)开发并维护,当前版本 v1.0.1。

💬 留言讨论