Image Transforms
The Buildpad Engine can resize, crop and convert an image when it serves it. Add transform parameters to /api/files/assets/:id on the Engine, or to a signed URL. The Studio’s own /api/assets/:id route sends the parameters on to the Engine. The Engine checks the credential first: a caller who cannot read the original cannot read a transformed copy.
GET /api/files/assets/<id>?width=300&height=200&fit=cover&quality=80
GET /api/files/assets/<id>?key=system-medium-coverOn a Buildpad Cloud project, image transforms need data service version 2026.10.11 or later. To use them on an older project, update the data service version.
Parameters
| Parameter | Values | Description |
|---|---|---|
width | 1–4096 | Target width in pixels |
height | 1–4096 | Target height in pixels |
fit | cover, contain, inside, outside | Resize mode. With both sizes and no fit, the Engine uses cover |
quality | 1–100 | JPEG quality. The default is 80. It has no effect on PNG and TIFF |
format | auto, jpg (or jpeg), png, tiff | Output format. auto is the default |
withoutEnlargement | true, false | Do not make the image larger than its own size |
focal_point_x, focal_point_y | pixels | The point that cover crops around. Give both or neither. Without them, the Engine uses the file’s own focal point, then the center |
key | preset name | A preset. See Presets |
How the fit modes work:
cover: exactlywidth×height. The Engine crops the image around the focal point.contain: exactlywidth×height. The whole image is centered on a black background.inside: the largest image with the same aspect ratio that fits in the box.outside: the smallest image with the same aspect ratio that covers the box.- With only one of
widthandheight, the Engine calculates the other from the aspect ratio, whateverfitsays.
How the formats work:
autokeeps a JPEG as JPEG and a PNG as PNG. It changes any other image to PNG when the image has transparency, and to JPEG when it has none.- The Engine cannot write WebP or AVIF. A request for
webporavifgets theautoresult, JPEG or PNG. - A request with only
qualityorformatchanges the encoding and keeps the size.
The Engine reads JPEG, PNG, GIF, WebP, TIFF and BMP. It applies the EXIF orientation before it resizes, and it removes the EXIF and other metadata from the result. An animated GIF becomes a still image of its first frame. Other files, such as PDF, SVG, video, HEIC, AVIF and animated WebP, come back unchanged, and the transform parameters are ignored.
Presets
key names a preset. The six system presets are always available:
| Key | Result |
|---|---|
system-small-cover | 64 × 64, cover |
system-small-contain | width 64, contain |
system-medium-cover | 300 × 300, cover |
system-medium-contain | width 300, contain |
system-large-cover | 800 × 800, cover |
system-large-contain | width 800, contain |
Each system preset uses format=auto. An administrator can add more presets in the storage_asset_presets setting (PATCH /api/settings). It is a list of objects, each with a unique key that does not start with system-, and the transform parameters above:
{ "storage_asset_presets": [ { "key": "card", "width": 120, "height": 90, "fit": "cover" } ] }Parameters in the request take the place of the preset’s values. For example, ?key=card&width=60 gives a 60 × 90 image.
The Engine refuses a settings write with a list that is not valid, with 400 INVALID_PAYLOAD, and writes nothing.
Transform mode
The storage_asset_transform setting controls which transforms the Engine accepts. The Engine reads it on each request, so a change applies at once.
| Value | Accepted |
|---|---|
all (the default, also when empty) | Every transform |
presets | Only a key that names a preset, with no other transform parameter |
none | Only a key that names a system preset, with no other transform parameter. Any other stored value acts as none |
A request with no transform parameter gets the original file in every mode. An administrator sets the mode with PATCH /api/settings. A value other than all, presets and none is refused with 400 INVALID_PAYLOAD.
Limits
The Engine refuses an image that is too large before it decodes it. The operator can change each limit with an Engine setting:
| Limit | Default | Engine setting |
|---|---|---|
| Size of the original file | 25 MiB | ASSETS_TRANSFORM_MAX_INPUT_BYTES |
| Longest side of the original | 6,000 pixels | ASSETS_TRANSFORM_IMAGE_MAX_DIMENSION |
| Pixels in the original | 24,000,000 | ASSETS_TRANSFORM_MAX_INPUT_PIXELS |
| Longest side of the result | 4,096 pixels | ASSETS_TRANSFORM_MAX_OUTPUT_DIMENSION |
| Time for one transform | 7.5 seconds | ASSETS_TRANSFORM_TIMEOUT_MS |
| Transforms at the same time, in one Engine process | 2 | ASSETS_TRANSFORM_MAX_CONCURRENT |
| Requests that wait for a free slot | 4 | ASSETS_TRANSFORM_MAX_WAITING |
| Time that a request waits for a slot | 2 seconds | ASSETS_TRANSFORM_WAIT_MS |
The Engine keeps each result in the file’s storage location and serves it again without a new transform. It keeps up to 32 results for each file. When a file is replaced or deleted, the Engine removes its results. A result is not a file: it does not appear in GET /api/files.
Errors
| Status | Code | Meaning |
|---|---|---|
400 | INVALID_QUERY | A parameter is not valid, is given twice, or names a preset that does not exist (Key "<key>" isn't configured). Also a transform that the transform mode does not allow |
400 | ILLEGAL_ASSET_TRANSFORMATION | The image is larger than a limit, or the Engine cannot decode it |
503 | SERVICE_UNAVAILABLE | The transform took too long, or every slot is busy. The answer has Retry-After: 2 |