Skip to main content
Every approved photo has up to three pre-generated WebP versions created automatically during upload processing.

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 empty versions array. In a published gallery all versions should be ready.

When to use getMediaUrl instead

Use getMediaUrl() 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