← Back to Skills Marketplace
226
Downloads
0
Stars
0
Active Installs
1
Versions
Install in OpenClaw
/install image-compression
Description
Automatically compresses images exceeding Telegram's 10MB limit by resizing width, adjusting quality, and preserving the original file with a new name.
README (SKILL.md)
图片自动压缩技能
自动检测图片大小,当图片超过 Telegram 发送限制(10MB)时自动压缩,确保图片能够成功发送。
功能特性
- 自动检测:自动检查图片大小是否超过限制
- 智能压缩:
- 调整图片宽度(默认 1024px)
- 优化图片质量(默认 85%)
- 支持多种格式(PNG、JPEG、GIF)
- 保留原文件:压缩后生成新文件,不修改原文件
- 输出文件名:自动添加 "_compressed" 后缀
使用场景
- 发送大图片到 Telegram
- 优化图片大小以减少网络传输时间
- 确保图片符合特定平台的尺寸限制
技术实现
- 使用 macOS
sips命令进行图片压缩 - 支持调整压缩参数
- 自动处理文件路径和文件名
依赖
- macOS
sips工具(系统自带)
使用方法
# 压缩图片(默认参数)
bash scripts/compress_image.sh "/path/to/image.png"
# 自定义宽度
bash scripts/compress_image.sh "/path/to/image.png" 800
# 自定义宽度和质量
bash scripts/compress_image.sh "/path/to/image.png" 800 80
# 发送压缩后的图片到微信文件传输助手
bash scripts/compress_and_send.sh "/path/to/image.png" "文件传输助手"
配置选项
- max_width:压缩后图片的最大宽度(默认 1024px)
- quality:压缩质量(0-100,默认 85)
- max_size:触发压缩的图片大小阈值(默认 10MB)
脚本说明
scripts/compress_image.sh:基本压缩功能scripts/compress_and_send.sh:压缩后发送到微信scripts/compress_and_send_telegram.sh:压缩后发送到 Telegram
示例
# 压缩并发送到微信
bash scripts/compress_and_send.sh "/Users/honcy/Desktop/screenshot_20260221_231100.png" "文件传输助手"
# 压缩并发送到 Telegram
bash scripts/compress_and_send_telegram.sh "/Users/honcy/Desktop/screenshot_20260221_231100.png" 5578370460
Usage Guidance
Do not run these scripts without inspection. Specific recommendations:
- Open and review scripts/compress_and_send.sh and scripts/compress_and_send_telegram.sh; note the hard-coded path /Users/honcy/.openclaw/skills/WeChat-Send/scripts/wechat_send_image.sh — remove or replace it with a configurable call (or verify that the target script is trustworthy).
- Confirm you want the WeChat-send behavior (the README/description focuses on Telegram but the skill has WeChat integration).
- Ensure the 'openclaw' CLI the scripts call is the expected trusted tool on your machine before running; if not present the Telegram send will fail safely but won't execute unexpected network calls.
- Run the compression script on non-sensitive images first and prefer running scripts under a restricted/test account or sandbox.
- If you plan to use this skill, edit the scripts to avoid absolute author-specific paths and make external senders configurable arguments so they can't accidentally execute arbitrary files in users' home directories.
Capability Analysis
Type: OpenClaw Skill
Name: image-compression
Version: 1.0.0
The skill bundle contains shell scripts that lack input sanitization for file paths and contact names, which could lead to command injection if provided with maliciously crafted inputs. Most notably, 'scripts/compress_and_send.sh' contains a hardcoded absolute path to a specific user's home directory ('/Users/honcy/'), indicating poor security practices and a dependency on an external, user-specific environment. While the stated purpose of image compression is legitimate, these implementation flaws pose a risk to the host system.
Capability Assessment
Purpose & Capability
The name/description (compress images for Telegram) aligns with the included scripts and SKILL.md, which use macOS sips and provide Telegram sending. However the package also contains a script to send to WeChat and references a WeChat sender — that extra integration is not highlighted in the top-level metadata and is a mild mismatch.
Instruction Scope
The runtime instructions and the scripts are limited to local image processing and invoking messaging senders, which is expected. However scripts call external commands/apis without declaring them and one script (scripts/compress_and_send.sh) invokes a hard-coded absolute path: /Users/honcy/.openclaw/skills/WeChat-Send/scripts/wechat_send_image.sh. That assumes a specific local file on the maintainer's machine; if present it will be executed. This is an incoherent and risky assumption.
Install Mechanism
This is an instruction-only skill with no install spec. Nothing is downloaded or written by an installer. The scripts rely on system-provided macOS 'sips' and optionally 'optipng' if present.
Credentials
The skill requests no environment variables or credentials, which is appropriate for a local compressor. However it implicitly depends on external tools/commands that are not declared: the 'openclaw' CLI (used to send Telegram messages) and the hard-coded WeChat sender script path. These undeclared external dependencies are disproportionate and could lead to unexpected execution if those binaries/scripts exist on a host.
Persistence & Privilege
The skill does not request 'always: true' and does not try to modify other skills or system configuration. It runs as invoked and does not persist or escalate privileges by itself.
How to Use
- Make sure OpenClaw is installed (local or Docker)
- Run the install command in chat:
/install image-compression - After installation, invoke the skill by name or use
/image-compression - Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
- Initial release of image-compression skill.
- Automatically detects image size and compresses if above Telegram's 10MB limit.
- Supports width, quality, and format adjustment (PNG, JPEG, GIF) using macOS sips.
- Compressed images have "_compressed" suffix; original files remain unchanged.
- Includes scripts to compress images and send them to WeChat or Telegram.
- Configurable max width, quality, and compression size threshold.
Metadata
Frequently Asked Questions
What is Image Compression?
Automatically compresses images exceeding Telegram's 10MB limit by resizing width, adjusting quality, and preserving the original file with a new name. It is an AI Agent Skill for Claude Code / OpenClaw, with 226 downloads so far.
How do I install Image Compression?
Run "/install image-compression" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.
Is Image Compression free?
Yes, Image Compression is completely free, licensed under MIT-0. You can download, install and use it at no cost.
Which platforms does Image Compression support?
Image Compression is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).
Who created Image Compression?
It is built and maintained by Honcy Ye (@yeholdon); the current version is v1.0.0.
More Skills