gioppy/statamic-glide-rest
Composer 安装命令:
composer require gioppy/statamic-glide-rest
包简介
An addon for Statamic 4 to add glide images on assets API endpoint
README 文档
README
Statamic Glide Rest is a Statamic addon that expose glide thumbnails on a Rest API endpoint.
How to Install
composer require gioppy/statamic-glide-rest
How to Use
The plugin takes only glide presets at the moment, not inline definition of a thumbnail. Before use it, create some presets on regular config file (config/statamic/assets.php);
After that, call the endpoint /glide?presets=preset1,preset2,...&id=container::path passing the container name, the path (or name) of the image and a list of a presets.
The response is a normal asset response but with thumbnails node:
{
"alt": "",
"id": "demo::01.jpg",
"title": "01.jpg",
"path": "01.jpg",
"filename": "01",
"basename": "01.jpg",
"extension": "jpg",
"is_asset": true,
"is_audio": false,
"is_previewable": false,
"is_image": true,
"is_svg": false,
"is_video": false,
"blueprint": {
"title": "Demo",
"handle": "demo"
},
"edit_url": "http://localhost/cp/assets/browse/demo/01.jpg/edit",
"container": {
"id": "demo",
"title": "Demo",
"handle": "demo",
"disk": "public",
"blueprint": {
"title": "Demo",
"handle": "demo"
},
"search_index": null,
"api_url": null
},
"folder": "/",
"url": "http://localhost/storage/01.jpg",
"permalink": "http://localhost/storage/01.jpg",
"api_url": "http://localhost/api/assets/demo/01.jpg",
"size": "71.35 KB",
"size_bytes": 73062,
"size_kilobytes": 71.35,
"size_megabytes": 0.07,
"size_gigabytes": 0,
"size_b": 73062,
"size_kb": 71.35,
"size_mb": 0.07,
"size_gb": 0,
"last_modified": "2023-12-03T09:23:00.000000Z",
"last_modified_timestamp": 1701595380,
"last_modified_instance": "2023-12-03T09:23:00.000000Z",
"focus": "50-50-1",
"has_focus": false,
"focus_css": "50% 50%",
"height": 800,
"width": 1200,
"orientation": "landscape",
"ratio": 1.5,
"mime_type": "image/jpeg",
"duration": null,
"duration_seconds": null,
"duration_minutes": null,
"duration_sec": null,
"duration_min": null,
"playtime": "31:09",
"thumbnails": {
"small": "http://localhost/containers/demo/01.jpg/b7213a45700ddc51ab273d1b889dfb67.jpg",
"medium": "http://localhost/containers/demo/01.jpg/648c933c5121599e77e74976196aedb2.jpg"
}
}
A side note
At the moment is not possible to register Rest endpoint on a Statamic addon, so this module must be called without /api prefix.
TODO
- Basic integration
- Handle errors
- Inline thumb definition
- Test
gioppy/statamic-glide-rest 适用场景与选型建议
gioppy/statamic-glide-rest 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 149 次下载、GitHub Stars 达 0, 最近一次更新时间为 2023 年 12 月 04 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 gioppy/statamic-glide-rest 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 gioppy/statamic-glide-rest 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 149
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 7
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2023-12-04