tingwei1123

smart-image-loader

デザイン・メディアv1.0.0
作者:tingwei1123更新日 2026-05-11@clawhub_tingwei1123/smart-image-loader
画像編集ビジュアル素材#Local Files

AlphaMoatによると、2026-09時点でsmart-image-loaderのダウンロード数は2,808、スター数は1で、AIスキル全体5,078件中3,864位、デザイン・メディアでは512件中370位です。

インストール数
195
ダウンロード数
2808
スター数
1
総合順位
#3,864
全体の上位 77% · デザイン・メディアの上位 73%
プラットフォームインストール数ダウンロード数スター数コメント
ClawHub ↗8725751-
SkillHub ↗19528081—

プラットフォームごとに集計方法と集計時点が異なります。

このスキルでできること

ローカル画像はreadツールで表示し、リモート画像は先に一時ダウンロードします。パスを承認済みディレクトリに限定し、内容形式とサイズを検査してください。一時ファイルはパスを埋め込んだシェル命令ではなく、安全なファイルAPIで削除します。

資料公開日 2026-10-27

できること

  • 許可された画像の表示

使う場面

  • 許可された画像の表示が必要なとき。

プロンプト例

スキルのドキュメントをもとに生成した例であり、実際の実行結果ではありません。

この許可されたローカル画像を表示し、作業領域外のパスなら知らせて。

月次の推移

ダウンロード数2808
1905239028752026-03 · ダウンロード数 19722026-05 · ダウンロード数 22182026-07 · ダウンロード数 24792026-08 · ダウンロード数 25412026-09 · ダウンロード数 280826-0326-09
スター数1
0122026-03 · スター数 12026-05 · スター数 12026-07 · スター数 12026-08 · スター数 12026-09 · スター数 126-0326-09

2026-09 から集計方法を変更し、同名スキルを作者ごとに分けて集計し、全スキルを対象にしました。破線は変更前の月で、変更後のデータとは直接比較せず、変更をまたぐ増減も計算していません。

月ダウンロード数前月比スター数
2026-092808—1
2026-082541+2.5%1
2026-072479—1
2026-052218—1
2026-031972—1

SKILL.md 原文

作者が公開した元のファイルをテキストのまま表示しています。AlphaMoat による編集や審査はしていません。リンクはクリックできません。コマンドは内容を確認してから実行してください。取得日 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:
すべて表示(全 123 行)

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 |

デザイン・メディアの人気スキル

データ月:2026-09 · ダウンロード数、スター数、インストール数は公開スキルレジストリ(ClawHub、SkillHub)から月単位で集計しています。詳しくはデータの方法論をご覧ください。