tingwei1123

smart-image-loader

Design & Mediav1.0.0
By tingwei1123Updated 2026-05-11@clawhub_tingwei1123/smart-image-loader
Image EditingVisual Assets#Local Files

According to AlphaMoat, as of 2026-09, smart-image-loader has 2,808 downloads and 1 stars — ranked #3,864 of 5,078 AI skills overall, and #370 of 512 in Design & Media.

Installs
195
Downloads
2.8K
Stars
1
Overall Rank
#3,864
Top 77% overall · Top 73% in Design & Media
PlatformInstallsDownloadsStarsComments
ClawHub ↗872.6K1-
SkillHub ↗1952.8K1—

Platforms count differently and update at different times.

What this skill does

Local images are displayed with a read tool; remote images are downloaded temporarily first. Restrict paths to authorized directories, validate remote content type and size, and remove temporary files with a safe file API rather than interpolated shell commands.

Profile published 2026-10-27

What you can do with it

  • viewing an authorized image

When to use it

  • When you need viewing an authorized image.

Example prompts

Generated from the skill’s documentation as examples; not results of actual runs.

Display this approved local image and report if its path falls outside the workspace.

Monthly Trend

Downloads2.8K
1.9K2.4K2.9K2026-03 · Downloads 2.0K2026-05 · Downloads 2.2K2026-07 · Downloads 2.5K2026-08 · Downloads 2.5K2026-09 · Downloads 2.8K26-0326-09
Stars1
0122026-03 · Stars 12026-05 · Stars 12026-07 · Stars 12026-08 · Stars 12026-09 · Stars 126-0326-09

The counting method changed in 2026-09: skills with the same name are now counted separately by author, and the full catalog is covered. Dashed lines show months before the change; they are not compared with later months, and no growth is computed across the change.

MonthDownloadsMoMStars
2026-092.8K—1
2026-082.5K+2.5%1
2026-072.5K—1
2026-052.2K—1
2026-032.0K—1

SKILL.md (original)

The author’s original file, shown as plain text without edits or review by AlphaMoat. Links are not clickable; check commands before running them. Fetched 2026-10-23.

3.6 KB · ClawHub v1.0.0
---
name: smart-image-loader
description: 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.
---

# Smart Image Loader

## Quick Start

When a user asks to display an image:
Show all (123 lines)

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

```bash
python3 scripts/smart_image_loader.py <image_path_or_url>
```

### Arguments

| Argument | Description |
|----------|-------------|
| `image_path_or_url` | Either 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

```bash
# 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

| Scenario | Action |
|----------|--------|
| URL download fails | Report error to user |
| Local file not found | Report error to user |
| Invalid input | Show usage instructions |

Popular in Design & Media

Data month: 2026-09 · Downloads, stars and installs are aggregated monthly from public skill registries (ClawHub, SkillHub). See methodology.