https://github.com/bangumi/img-proxy
image processing server for bgm.tv
https://github.com/bangumi/img-proxy
Last synced: about 2 months ago
JSON representation
image processing server for bgm.tv
- Host: GitHub
- URL: https://github.com/bangumi/img-proxy
- Owner: bangumi
- Created: 2022-12-22T10:19:43.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2025-02-28T19:23:50.000Z (about 2 months ago)
- Last Synced: 2025-02-28T22:56:30.408Z (about 2 months ago)
- Language: Go
- Homepage:
- Size: 316 KB
- Stars: 1
- Watchers: 3
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# readme
动态切图服务器
GET `/r/{size}/{path}`
example:
- `/r/100/pic/cover/l/b4/4f/18692_E04qh.jpg`
- `/r/100x0/pic/cover/l/b4/4f/18692_E04qh.jpg`
- `/r/0x100/pic/cover/l/b4/4f/18692_E04qh.jpg`
- https://lain.bgm.tv/r/400/pic/cover/l/53/6a/1453_iZIOZ.jpgsize 应该是 `${width}` 或者 `${width}x${height}` 格式,如 `400`, `200x0`, `200x200` `0x200`。`200` 和 `200x0`含义相同。
width 或者 height 为 0 表示仅缩放,同时不为0的情况为缩放+裁剪。两种情况下图片的宽高比均会保持不变。
可用的 width height
- 100
- 200
- 400
- 600
- 800
- 1200不合法的尺寸参数会直接返回 bad request
本仓库的代码仅仅是 http
gateway,实际的图片处理由 [imaginary](https://github.com/h2non/imaginary)
进行,处理后的图片储存在 s3 (minio)。