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.

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "smart-image-loader" with this command: npx skills add tingwei1123/smart-image-loader

Smart Image Loader

Quick Start

When a user asks to display an image:

  1. Check if input is a URL or local path

    • URLs start with http:// or https://
    • Local paths are file paths in the workspace
  2. For URLs:

    • Download the image to a temporary location using the Python script
    • Use read tool to display the image
    • Clean up the temporary file afterward
  3. For local files:

    • Verify the file exists (relative to workspace or absolute path)
    • Use read tool directly to display the image

Usage Examples

User says: "Show me this image: https://example.com/photo.jpg"

  1. Run: python3 scripts/smart_image_loader.py https://example.com/photo.jpg
  2. Script downloads to temp: /tmp/dir/photo.jpg
  3. Use read tool on: /tmp/dir/photo.jpg
  4. Clean up: Delete the temp file

User says: "Display ./images/logo.png"

  1. Run: python3 scripts/smart_image_loader.py ./images/logo.png
  2. Script verifies file exists
  3. Use read tool on: /home/node/clawd/images/logo.png (absolute path)

Script Usage

python3 scripts/smart_image_loader.py <image_path_or_url>

Arguments

ArgumentDescription
image_path_or_urlEither a local file path (relative or absolute) or a URL

Output Format

The script returns a JSON-like output with:

  • Status: SUCCESS or FAILED
  • Type: url or local
  • File Path: Local path for the read tool
  • Message: Status description
  • Cleanup Needed: true if temp file should be deleted

Examples

# URL example
python3 scripts/smart_image_loader.py https://example.com/image.jpg
# Output: Downloads to /tmp/xyz/image.jpg, use read tool on that path

# Local file example (relative)
python3 scripts/smart_image_loader.py ./photos/vacation.jpg
# Output: File found at /home/node/clawd/photos/vacation.jpg

# Local file example (absolute)
python3 scripts/smart_image_loader.py /home/node/clawd/downloads/graphic.png
# Output: File found at /home/node/clawd/downloads/graphic.png

Workflow Decision Tree

User asks to display an image
         |
         v
    Is it a URL? (http:// or https://)
         |
    +----+---------------------------+
    |                                 |
   YES                               NO
    |                                 |
    v                                 v
Download to temp              Does file exist?
    |                                 |
    v                          +-----+-----+
Use read tool                 |           |
    |                        YES          NO
    v                              |
Cleanup temp file              v
                           Use read tool
                               |
                               v
                          Done (no cleanup)

Cleanup Guidelines

  • URL downloads: Always clean up temporary files after displaying
  • Local files: No cleanup needed (files remain in workspace)
  • Use exec with rm <file_path> for cleanup

Image Formats Supported

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

Error Handling

ScenarioAction
URL download failsReport error to user
Local file not foundReport error to user
Invalid inputShow usage instructions

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Automation

技能编辑器

编辑、完善或审查 AgentSkills。当需要创建新技能、对现有 SKILL.md 进行修改、清理/审计/整理技能文件时激活此技能。触发词:编辑技能, skill 注意事项, metadata 检查, 完善技能, 清理技能, 审计技能, skill 规范, 编写 skill, 新建技能

Registry SourceRecently Updated
Automation

全闭环管道

全闭环自动化管道 — Hunter→Skill Factory→Orchestrator→Dashboard→Profit。将Phase 1-3所有组件串联为自动运行的超级管道。核心能力:(1) 一键全流程 (2) 定时自动运行 (3) 异常自愈 (4) 利润报告

Registry SourceRecently Updated
Automation

智美人AI实战课

《智美人AI Agent实战课》配套技能——从0到1搭建AI Agent的完整课程体系。第01节:AI Agent基础概念+工具链搭建。课程内容含数字人讲解视频、实战代码、课后练习。覆盖:OpenClaw配置、技能安装、MCP工具、多Agent协同、变现实战。

Registry SourceRecently Updated
Automation

利润优化引擎

利润优化引擎 — 订单管理/计价/结算模拟。核心能力:(1) 订单管理 (2) 计价模型 (3) 成本追踪 (4) 利润计算

Registry SourceRecently Updated