闲社服务运行正常AI智能体自动化平台
s

智能图片加载器

技能标识:smart-image-loader

Smart image loader that handles both URLs and local files, automatically downloads URLs to temporary locations, and displays images using the read tool. Use when a user wants to view or display an image, whether it's a web URL or a file in the workspace.

作者:admin | 来源记录:ClawHub
登记来源
ClawHub
版本
V 1.0.0
检测标记
后台标记通过
免费
免费获取
1
收藏
来源与检测标记为平台登记信息,并不代表已展示可复核的检测报告。使用前请核对版本、依赖和所需权限,建议先在隔离环境中运行。
概述
安装方式
版本历史

智能图片加载器

智能图片加载器

快速开始

当用户要求显示图片时:

  1. 1. 检查输入是URL还是本地路径
- URL以http://或https://开头 - 本地路径是工作区中的文件路径
  1. 2. 对于URL:
- 使用Python脚本将图片下载到临时位置 - 使用read工具显示图片 - 之后清理临时文件
  1. 3. 对于本地文件:
- 验证文件是否存在(相对于工作区或绝对路径) - 直接使用read工具显示图片

使用示例

用户说: 给我看这张图片:https://example.com/photo.jpg

  1. 1. 运行:python3 scripts/smartimageloader.py https://example.com/photo.jpg
  2. 脚本下载到临时目录:/tmp/dir/photo.jpg
  3. 在/tmp/dir/photo.jpg上使用read工具
  4. 清理:删除临时文件

用户说: 显示./images/logo.png

  1. 1. 运行:python3 scripts/smartimageloader.py ./images/logo.png
  2. 脚本验证文件是否存在
  3. 在/home/node/clawd/images/logo.png(绝对路径)上使用read工具

脚本使用

bash
python3 scripts/smartimageloader.py <图片路径或URL>

参数

参数描述
图片路径或URL本地文件路径(相对或绝对)或URL

输出格式

脚本返回类似JSON的输出,包含:

  • - Status:SUCCESS或FAILED
  • Type:url或local
  • File Path:供read工具使用的本地路径
  • Message:状态描述
  • Cleanup Needed:如果需要删除临时文件则为true

示例

bash

URL示例


python3 scripts/smartimageloader.py https://example.com/image.jpg

输出:下载到/tmp/xyz/image.jpg,在该路径上使用read工具

本地文件示例(相对路径)

python3 scripts/smartimageloader.py ./photos/vacation.jpg

输出:文件位于/home/node/clawd/photos/vacation.jpg

本地文件示例(绝对路径)

python3 scripts/smartimageloader.py /home/node/clawd/downloads/graphic.png

输出:文件位于/home/node/clawd/downloads/graphic.png

工作流程决策树

用户要求显示图片
|
v
是否为URL?(http://或https://)
|
+----+---------------------------+
| |
是 否
| |
v v
下载到临时目录 文件是否存在?
| |
v +-----+-----+
使用read工具 | |
| 是 否
v |
清理临时文件 v
使用read工具
|
v
完成(无需清理)

清理指南

  • - URL下载:显示后始终清理临时文件
  • 本地文件:无需清理(文件保留在工作区中)
  • 使用exec配合rm <文件路径>进行清理

支持的图片格式

  • - JPEG(.jpg, .jpeg)
  • PNG(.png)
  • GIF(.gif)
  • WebP(.webp)
  • BMP(.bmp)

错误处理

场景操作
URL下载失败向用户报告错误
本地文件未找到
向用户报告错误 | | 无效输入 | 显示使用说明 |

标签

skill ai

通过对话安装

以下为平台配置的接入选项,并非逐项实测通过。能否安装取决于客户端支持、技能来源和运行环境:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 smart-image-loader-1776368185 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 smart-image-loader-1776368185 技能

通过命令行安装

skillhub install smart-image-loader-1776368185

下载

⬇ 下载 smart-image-loader v1.0.0(免费)

文件大小: 3.62 KB | 发布时间: 2026-4-17 14:10

v1.0.0 最新 2026-4-17 14:10
Initial release of smart-image-loader.

- Supports displaying images from both URLs and local files.
- Automatically downloads images from URLs to a temporary location and cleans up after display.
- Verifies existence of local image files and displays them directly.
- Outputs a structured JSON-like response for integration with the read tool.
- Includes detailed usage instructions, workflow, and error handling guidelines.
返回顶部