Skill: fm7077/easyimage-uploader-py (version 1.0.0)

--- name: easyimage-uploader description: Upload local image files to an EasyImages 2.0 service and return the hosted image URL. Use when the user asks to upload an image, host a picture, put a local screenshot/photo onto an EasyImages server, or wants a sharable image link generated from a local file. This skill supports skill-local configuration via config.json, with CLI flags or environment variables as fallback. --- # easyimage-uploader Upload a local image to an EasyImages 2.0 server, then return the hosted image URL. ## Configuration priority Resolve configuration in this order: 1. CLI flags: `--server` and `--token` 2. Skill-local config file: `config.json` 3. Environment variables fallback: - `EASYIMAGE_URL` - `EASYIMAGE_TOKEN` Recommended setup: create `config.json` in the root of this skill. Example: ```json { "server": "https://img.example.com", "token": "your-easyimage-token", "allow_model_image_input": false, "temp_dir": "./temp" } ``` A template file is included as `config.example.json`. ## Config fields - `server`: EasyImages service base URL - `token`: EasyImages upload token - `allow_model_image_input`: whether upload requests are allowed to rely on model-side image understanding - `false`: prefer direct file-path upload only, avoid image analysis, avoid vision tool usage - `true`: model-side image handling is allowed when needed - `temp_dir`: temp working directory for this skill - default recommended value: `./temp` - relative paths are resolved relative to this `SKILL.md` / skill root directory - with the default, the effective directory is `easyimage-uploader/temp/` If configuration is missing, stop and ask the user for the missing value. ## Workflow 1. Confirm which local image file should be uploaded. 2. Read `references/api.md` if you need the exact upstream API shape or status meanings. 3. Read `config.json` when behavior matters. 4. If `allow_model_image_input` is `false`, do not use image analysis or vision tools just to understand image content. Treat the image as a file and upload by path only. 5. Use `temp_dir` for temporary files when downloads, conversions, or intermediate storage are needed. If the directory does not exist, create it first. 6. Prefer absolute paths for both the script and the image file. Do not rely on `~` expansion in generated commands. Safe default: ```bash python3 /absolute/path/to/skills/easyimage-uploader/scripts/upload_easyimage.py /absolute/path/to/image ``` 7. If needed, point to a specific config file with an absolute path: ```bash python3 /absolute/path/to/skills/easyimage-uploader/scripts/upload_easyimage.py /absolute/path/to/image \ --config /absolute/path/to/config.json ``` 8. If needed, override with explicit CLI values: ```bash python3 /absolute/path/to/skills/easyimage-uploader/scripts/upload_easyimage.py /absolute/path/to/image \ --server https://img.example.com \ --token YOUR_TOKEN ``` 9. The bundled script normalizes `~` and relative paths for the image and config arguments, but still prefer absolute paths in examples and real executions to avoid shell-specific surprises. 10. Parse the JSON output. 11. If `ok` is true, return the `url` to the user. Mention `thumb` only if useful. 12. Do not expose `delete_url` unless the user explicitly asks for deletion capability. 13. If upload fails, explain the likely cause using the `code` or error payload. ## Failure handling When the script returns a failure payload: - `network_error`: server unreachable, DNS/TLS/network problem, or timeout - `http_error`: server returned a non-2xx HTTP response - `invalid_json`: server responded unexpectedly - EasyImages `code` values should be interpreted using `references/api.md` Common user-facing explanations: - `202`: server-side upload quota reached - `205`: current client is blocked by EasyImages allow/deny rules - `401`: server requires login uploads instead of token-only uploads - `403`: token invalid or signature check failed - `406`: file type rejected ## Notes - Use this skill for local files that already exist on disk. - If the user only gives a remote URL and wants it mirrored, download it first only if appropriate and allowed. - Prefer returning the direct image `url` as the main result. - Keep secrets safe. Never echo the configured token back to the user. - `config.json` contains secrets. Keep file permissions tight and avoid committing it to public repositories.

path: config.example.json
content: server: https://img.example.com
token: replace-with-your-easyimage-token
allow_model_image_input: no
temp_dir: ./temp

path: README.md
content: # easyimage-uploader

Upload local image files to an EasyImages 2.0 service and return the hosted image URL.

This skill is for OpenClaw / AgentSkills style workflows where the assistant should treat images as files and upload them to an EasyImages server through the official API.

## Features

- Upload local image files to EasyImages 2.0
- Return direct hosted image URLs
- Support skill-local `config.json`
- Support CLI flags and environment variables as fallback
- Support a config switch to avoid model-side image handling
- Support a configurable temp working directory

## Supported configuration

Create `config.json` in the skill root:

```json
{
  "server": "https://img.example.com",
  "token": "your-easyimage-token",
  "allow_model_image_input": false,
  "temp_dir": "./temp"
}
```

### Fields

- `server`: EasyImages base URL
- `token`: EasyImages upload token
- `allow_model_image_input`: whether upload requests are allowed to rely on model-side image understanding
  - `false`: prefer direct file-path handling and avoid unnecessary image analysis
  - `true`: allow model-side image handling when needed
- `temp_dir`: temporary working directory for downloaded or intermediate files
  - default recommended value: `./temp`

## Config priority

The uploader resolves config in this order:

1. CLI flags: `--server` and `--token`
2. Skill-local `config.json`
3. Environment variables:
   - `EASYIMAGE_URL`
   - `EASYIMAGE_TOKEN`

## Usage

Basic usage:

```bash
python3 scripts/upload_easyimage.py /absolute/path/to/image.jpg
```

Use a specific config file:

```bash
python3 scripts/upload_easyimage.py /absolute/path/to/image.jpg \
  --config /absolute/path/to/config.json
```

Override with explicit values:

```bash
python3 scripts/upload_easyimage.py /absolute/path/to/image.jpg \
  --server https://img.example.com \
  --token YOUR_TOKEN
```

## Example response

Successful upload returns normalized JSON like:

```json
{
  "ok": true,
  "http_status": 200,
  "result": "success",
  "code": 200,
  "url": "https://img.example.com/i/2026/04/16/example.jpg",
  "thumb": "https://img.example.com/app/thumb.php?img=/i/2026/04/16/example.jpg"
}
```

## EasyImages API notes

This skill uses the official EasyImages 2.0 upload endpoint:

- `POST /api/index.php`
- multipart form fields:
  - `image`
  - `token`

If the server returns `API Closed`, enable API upload in EasyImages first.

## Common failure cases

- `202`: upload quota reached
- `205`: blocked by allowlist / denylist rules
- `401`: login upload required by server policy
- `403`: invalid token or signature failure
- `406`: file type rejected
- `API Closed`: EasyImages API upload is disabled on the server

## Files

- `SKILL.md`: agent-facing skill instructions
- `scripts/upload_easyimage.py`: upload helper script
- `references/api.md`: upstream API notes
- `config.example.json`: config template

## Security notes

- Do not commit real `config.json` secrets to a public repository.
- Keep your EasyImages token private.
- If you want to minimize model-side image token usage, keep `allow_model_image_input` set to `false` and prefer file-path based workflows.

## License

This project is licensed under the MIT License.

See [`LICENSE`](./LICENSE) for the full terms.

EasyImages itself is a separate upstream project:

- Upstream: <https://github.com/icret/EasyImages2.0>


path: references/api.md
content: # EasyImages 2.0 API notes

## Upload endpoint

Official upload API:

- Method: `POST`
- Path: `/api/index.php`
- Content-Type: `multipart/form-data`
- Fields:
  - `image`: the file to upload
  - `token`: EasyImages upload token

Base example:

```bash
curl -X POST https://your-easyimage-host/api/index.php \
  -F "image=@/path/to/file.jpg" \
  -F "[REDACTED_SECRET]"
```

## Success response

Typical JSON fields returned on success:

```json
{
  "result": "success",
  "code": 200,
  "url": "https://img.example.com/2023/01/24/example.webp",
  "srcName": "original-name",
  "thumb": "https://img.example.com/application/thumb.php?img=/i/2023/01/24/example.webp",
  "del": "https://img.example.com/application/del.php?hash=..."
}
```

Important fields:

- `url`: direct image URL to return to the user
- `thumb`: thumbnail URL when available
- `del`: delete URL, sensitive, usually avoid exposing unless the user asks

## Common status codes from EasyImages docs

Upload-related codes documented upstream:

- `200`: upload success
- `202`: upload limit exceeded
- `204`: no file selected
- `205`: uploader blocked by allowlist/denylist rules
- `400`: request or file problem
- `401`: login required by server policy
- `403`: bad upload signature or token problem
- `406`: illegal file

## Configuration expected by this skill

Provide both of these before uploading:

- `EASYIMAGE_URL`: EasyImages service base URL, for example `https://img.example.com`
- `EASYIMAGE_TOKEN`: upload token

The bundled script also accepts CLI flags:

- `--server`
- `--token`


Security scan verdicts — ClawScan: suspicious | static analysis: clean | VirusTotal: clean | SkillSpector: clean (LOW)