URL Structure and Order of Operations

B2C Commerce Dynamic Imaging Service image transformation requests use a /dw/image/v2/ path and a query string. Dynamic Imaging Service applies those parameters in a fixed order.

Which Salesforce Commerce Product Do I Have?

For transform types, parameter names, JavaScript transform objects, and validation details, use the Supported Transformations table. This page only explains path shape, order of operations, and how the output format relates to the URL.

What Does the Transformation URL Path Look Like? 

In B2C Commerce, transformed image URLs use the path segment /dw/image/v2/ with the usual static content path, for example on/demandware.static/.... Build URLs with the URLUtils and MediaFile classes described in How Do I Create an Image Transformation URL for B2C Commerce Images?.

How Does the File Extension Set the Output Format? 

In B2C Commerce, the file extension in the generated URL, for example .webp or .avif, selects the output format. The sfrm parameter, where needed, specifies the source image format. See the Format row in Supported Transformations.

In What Order Are Transformations Applied? 

In B2C Commerce, when multiple transform types apply to a single request, Dynamic Imaging Service processes them in this order. If you combine crop and scale, plan the crop on the original source image. Dynamic Imaging Service applies the crop first and then scales the result, not the other way around.

  1. Format (when specified)
  2. Background color (bgcolor), to flatten transparency where used
  3. Crop (cx, cy, cw, ch)
  4. Resize / scale mode (sw, sh, sm)
  5. Overlay (ox, oy, oimg)
  6. Quality (q)
  7. Metadata strip (strip)

Dynamic Imaging Service rejects requests with invalid parameters and returns 400 Bad Request. For the full rules, see Supported Transformations.

What Causes a 400 Response? 

In B2C Commerce, these request problems return 400 Bad Request.

  • Duplicate parameters in the same URL (?sw=100&sw=200). Last value wins, which can mask logic errors.
  • Empty values (?sw=&sh=400).
  • Wrong delimiter, usually a stray % instead of &.
  • Unencoded spaces or other reserved characters in an overlay URL.
  • Incomplete crop or overlay parameter sets.
  • Values outside the ranges in the Supported Transformations table, for example sw=5.

For file size, timeout, and caching, see What Limits and Caching Rules Apply? and Dynamic Imaging Caching. For failed requests, see Troubleshooting and Migration.

See Also