Wocart

@wocart/storefront v3.1.0


@wocart/storefront / index / mediaImageUrl

Function: mediaImageUrl()

mediaImageUrl(url, params, delivery): string

A photo of the store's media at the size and format a page shows it, from the delivery's own resizer: ImageKit's ?tr= or Cloudflare's /cdn-cgi/image/ (which falls back to the original when a resize fails).

Parameters

url

string

params

MediaImageParams

delivery

MediaDelivery

Returns

string

null without a delivery, for a URL not served by it, or for a direct delivery, which does not resize — show the original then.