Resizing
Resize images on the fly using the w and h query parameters. Aspect ratio is always preserved and images are never upscaled.
Parameters
| Parameter | Description | Example |
|---|---|---|
w | Target width in pixels | ?w=800 |
h | Target height in pixels | ?h=600 |
Behavior
- Width only (
?w=800) — height is calculated to preserve aspect ratio - Height only (
?h=600) — width is calculated to preserve aspect ratio - Both (
?w=800&h=600) — uses whichever dimension results in the larger output (contain behavior) - No params — the image is served at its original dimensions
Examples
/photo.jpg?w=400
/photo.jpg?h=300
/photo.jpg?w=800&h=600