图片和文字的跨时代合成 可选值为支持的范围
| 参数名 | 类型 | 描述 | 可选值 | 当前值 |
|---|---|---|---|---|
text |
string | 要生成图片的文字 | - | |
width |
integer | 图片宽度 | 400 | |
height |
integer | 图片高度 | 200 | |
brchars |
string | 换行分隔符,支持多个符号 | - | |
fontSize |
integer | 字号 | 48 | |
randomcolor |
boolean | 是否每行随机颜色 |
http://api.ling-shan.eu.org/api/imgtxt/
点击"试一试"按钮查看实际响应
| 场景 | HTTP 状态 | 错误码 | 消息 | JSON 结构预览 |
|---|---|---|---|---|
| text 参数为空或缺失 | 400 |
400 |
text 不能为空 | {
"error": {
"code": 400,
"message": "text 不能为空",
"text": {
"desc": "生成文字",
"type": "string",
"default": "hello"
}
}
} |
| 宽度超出范围 | 400 |
400 |
宽度需在 50-2000 之间 | {
"error": {
"code": 400,
"message": "宽度需在 50-2000 之间",
"width": {
"desc": "图片宽度",
"enum": [
50,
2000
],
"type": "integer",
"default": 400
}
}
} |
| 高度超出范围 | 400 |
400 |
高度需在 50-2000 之间 | {
"error": {
"code": 400,
"message": "高度需在 50-2000 之间",
"height": {
"desc": "图片高度",
"enum": [
50,
2000
],
"type": "integer",
"default": 200
}
}
} |
| 字号超出范围 | 400 |
400 |
字号需在 12-200 之间 | {
"error": {
"code": 400,
"message": "字号需在 12-200 之间",
"fontSize": {
"desc": "字号",
"enum": [
12,
200
],
"type": "integer",
"default": 48
}
}
} |
| brchars 超长或含非法字符 | 400 |
400 |
brchars 最长 10 个可见字符 | {
"error": {
"code": 400,
"message": "brchars 最长 10 个可见字符",
"brchars": {
"desc": "换行分隔符",
"type": "string",
"default": "\/",
"maxLength": 10,
"pattern": "^[\\x21-\\x7E]+$"
}
}
} |
| randomcolor 取值非法 | 400 |
400 |
randomcolor 只能为 true 或 false | {
"error": {
"code": 400,
"message": "randomcolor 只能为 true 或 false",
"randomcolor": {
"desc": "是否每行随机颜色",
"enum": [
"true",
"false"
],
"type": "string",
"default": "false"
}
}
} |
| 接口状态异常 | 503 |
503 |
接口异常,请联系管理员修复! | {
"error": {
"code": 503,
"message": "接口异常,请联系管理员修复!",
"status": "异常"
}
} |
| 接口维护中 | 503 |
503 |
接口维护中,请稍后再试 | {
"error": {
"code": 503,
"message": "接口维护中,请稍后再试",
"status": "维护"
}
} |
| 接口已下架 | 410 |
410 |
接口已下架 | {
"error": {
"code": 410,
"message": "接口已下架",
"status": "下架"
}
} |
| QPS 超限被封禁 | 429 |
429 |
请求频繁,请10秒后重试 | {
"error": {
"code": 429,
"message": "请求频繁,请10秒后重试",
"retry_after": 10
}
} |
| 字体文件缺失或损坏 | 500 |
500 |
字体文件缺失或损坏 | {
"error": {
"code": 500,
"message": "字体文件缺失或损坏"
}
} |
| svg 渲染失败 | 500 |
500 |
图片渲染失败 | {
"error": {
"code": 500,
"message": "图片渲染失败"
}
} |
| 服务器内部错误 | 500 |
500 |
服务器内部错误 | {
"error": {
"code": 500,
"message": "服务器内部错误"
}
} |
加载时间: 0ms
Copyright © 2024-2026 灵衫Pro. All Rights Reserved
浮笙网络