https://github.com/oeo/image-optimize-sls
an image optimization proxy
https://github.com/oeo/image-optimize-sls
Last synced: 2 months ago
JSON representation
an image optimization proxy
- Host: GitHub
- URL: https://github.com/oeo/image-optimize-sls
- Owner: oeo
- Created: 2023-09-27T21:41:11.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2023-09-27T23:15:12.000Z (over 1 year ago)
- Last Synced: 2025-01-25T22:22:14.995Z (4 months ago)
- Language: JavaScript
- Size: 203 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# image-optimize-sls
an image optimizing proxy designed to sit behind cloudfront or another cdn service
that for caching and edge distribution.## required
- `url`: the url of the image you want to optimize.## optional
- `format`: the format to convert the image to (e.g., 'webp', 'jpeg') (default: webp).
- `width`: the width to resize the image to.
- `height`: the height to resize the image to.
- `fit`: how to fit the image when both width and height are provided ('cover', 'contain', 'fill', 'inside', 'outside').
- `quality`: the quality of the image (0-100).
- `thumbnail`: whether to generate a thumbnail (true/false).
- `debug`: return debugging information in json (true/false).## examples
- `https://your-api.com/optimize?url=https://example.com/image.jpg`
- `https://your-api.com/optimize?url=https://example.com/image.jpg&format=webp&width=300&quality=85`
- `https://your-api.com/optimize?url=https://example.com/image.jpg&thumbnail=1`