Long Image Slicer
v1.0.1智能长截图切片工具。将超长图片(如聊天记录、长截图)按 9:16 比例智能切片,确保文字/拼音不被分割,输出 PDF/ZIP/切片图片。使用场景:用户发送长截图要求切片、分割、转 PDF 等。
MIT-0
Security Scan
OpenClaw
Benign
high confidencePurpose & 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.
Assessment
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.Like a lobster shell, security has layers — review code before you run it.
latest
License
MIT-0
Free to use, modify, and redistribute. No attribution required.
SKILL.md
Long Image Slicer - 长截图智能切片
触发条件
当用户提出以下需求时触发此技能:
- 长截图切片/分割
- 聊天记录转 PDF
- 超长图片处理
- 确保文字不被截断的切片
工作流程
1. 获取源图片
方式 A:用户直接发送
- 保存到临时目录
方式 B:用户提供 URL
curl -L "<图片 URL>" -o /tmp/source.jpg
方式 C:用户指定本地路径
- 直接使用用户提供的路径
2. 执行切片
cd ~/.openclaw/skills/long-image-slicer
python3 scripts/slice_processor.py <源图片路径> [输出目录]
脚本自动:
- 分析图片内容密度(检测文字行)
- 智能计算切分位置(确保文字/拼音完整)
- 生成切片图片(slice_01.jpg ~ slice_48.jpg)
- 保存到
输出目录/slices_v7/
3. 生成 PDF
python3 scripts/create_pdf.py <切片目录> [输出 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
示例对话
用户:这张长截图帮我切片,文字不要截断
助手:收到,使用长截图切片工具:
- 分析文字行位置
- 智能切分(确保拼音完整)
- 生成 48 个切片 + PDF
用户:把聊天记录转 PDF,A4 打印
助手:可以,生成长截图 PDF:
- A4 尺寸,所有切片完整显示
- 右下角页码
版本历史
- v7: 精细平衡版,81% 切片在目标范围
- PDF v5: 高度优先,左右边距相等,页码右下角
Files
3 totalSelect a file
Select a file to preview.
Comments
Loading comments…
