360 Secure SkillHub
360 安全技能中心

二维码生成器

该 Skill 通过 Python 脚本把文本、网址或本地图片转换为二维码图片,支持自定义尺寸和颜色,超过 10MB 的图片会被拒绝、较大图片自动压缩,运行后返回二维码图片路径,失败时返回错误信息。依赖 qrcode 与 pillow 两个 Python 包。

nbf819-web
nbf819-web
热度 65.60
最近更新 2026-05-17 12:24:31
分类:效率依赖:代码执行 / 读写文件应用场景:图像生成 / 文件转换 / 自动化脚本

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add pr-generator
Metadata
name
qrcode-generator
description
Generate QR codes from text, URLs, or images. Use when users ask to 'generate QR code', 'create QR', or 'make QR code for'. Supports text content, URLs, and local images (automatically compressed).
version
2.0.0
author
bowen nan
license
MIT
permissions
file read (specified image paths), file write (temp directory)

QR Code Generator

Generate QR codes from text, URLs, or local images. Perfect for sharing links, contact information, or small images via scannable codes.

Features

  • ✅ Generate QR codes from text
  • ✅ Generate QR codes from URLs
  • ✅ Generate QR codes from local images (auto-compressed)
  • ✅ Customizable QR code size and colors
  • ✅ Returns image path for easy sharing

Installation

pip install qrcode[pil] pillow

Usage Examples

Basic Usage

from agent import handle_call

# Generate QR for URL
result = handle_call({"content": "https://openclaw.ai"})

# Generate QR for text
result = handle_call({"content": "Hello OpenClaw"})

# Generate QR from image
result = handle_call({"image": "/path/to/image.jpg"})

Command Line

# Install dependencies first
pip install qrcode[pil] pillow

# Run the example
python example.py

Parameters

  • content (string): Text or URL to encode
  • image (string): Full path to local image file

Returns

  • image_path: Path to generated QR code image
  • error: Error message if failed
  • message: Informational message

Notes

  • Images larger than 10MB will be rejected
  • Large images are automatically compressed for QR encoding
  • For best results with images, use URLs instead of local files