The three versions
Dimensions are maximum — images are never upscaled. A 300px original produces a
webp_thumb of 300px, not 400px.Accessing version URLs
versions.ts
Responsive images with srcset
srcset.ts
responsive.html
Version availability
Versions are generated asynchronously after upload. A newly approved photo may briefly have an emptyversions array. In a published gallery all versions should be ready.
When to use getMediaUrl instead
UsegetMediaUrl() when you need:
- A size not covered by the three standard versions
- AVIF output (not pre-generated)
- A specific crop ratio (e.g. 1:1 square, 1200x630 OG)
- Custom quality for a specific context
decision.ts