> For the complete documentation index, see [llms.txt](https://docs.transparentedge.eu/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.transparentedge.eu/config/i3/automatic-resizing.md).

# Automatic resizing

[i3,](/config/i3.md) our solution for image management, allows you to dynamically and transparently resize your images.&#x20;

To do this, we use our `TCDN-i3-transform` header, specifying the type of operation we want, in this case, `resize.` Unlike other operations, such as converting to WebP format, this operation requires a mandatory parameter: the dimensions of the resulting image. The parameter has the format `<width>x<height>`, with both units expressed in pixels and accepting a maximum value of 4096 pixels for each dimension. A valid value, for example, would be `400x300.`&#x20;

The exact syntax for this operation is as follows: `resize:`*`<ancho>`*`x[`*`<alto>`*`][,fixed]`.&#x20;

Alternatively, instead of expressing a dimension in pixels, you can use the variable `orig`, which refers to the original size of the image. A valid value, for example, would be `origx300.`&#x20;

Furthermore, the dimension `<height>`is optional: if it is not specified, it is automatically calculated based on the set `<width>` to maintain the aspect ratio. A valid value, for example, would be `400x.`&#x20;

Similarly, if we want to set dimensions and explicitly prevent the crop that is applied to maintain the aspect ratio, we can append the `fixed` suffix to the dimensions. A valid value, for example, would be `400x300,fixed.` Note that, for example, the value `400x,fixed` would also be valid, although the fixed suffix would be meaningless in this case.&#x20;

For example, if we wanted to serve images from our domain `mi-dominio.es` with a size of `300 x 300 pixels`, located at the URL `/estaticos/imagenes`, we would simply deploy a [VCL](/config/vcl.md) [configuration](/config/easy-setup.md) similar to the following from the [dashboard](/getting-started/dashboard.md):

```c
# i3 - resize
sub vcl_recv {
    if (req.http.host == "www.mi-dominio.es") {
        if (req.url ~ "^/estaticos/imagenes/") {
            set req.http.TCDN-i3-transform = "resize:300x300";
        }
    }
}
```

Another possibility, for example, would be if we wanted to serve the images from `/estaticos/imagenes` in a discrete set of different sizes (e.g., `320x240`, `640x480`, and `800x600`) according to the URL `/estaticos/imagenes/<width>x<height>.` To achieve this, we would simply need to deploy a configuration similar to the following:

```c
# i3 - resize
sub vcl_recv {
    if (req.http.host == "www.mi-dominio.es") {
        if (req.url ~ "^/estaticos/imagenes/(320x200|640x400|800x600)/") {
            set req.http.size = regsub(req.url, "^/estaticos/imagenes/([0-9]+x[0-9]+)/(.*)", "\1");
            set req.url       = regsub(req.url, "^/estaticos/imagenes/([0-9]+x[0-9]+)/(.*)", "/estaticos/imagenes/\2");
            set req.http.TCDN-i3-transform = "resize:" + req.http.size;
            unset req.http.size;
        }
    }
}
```

Obviously, these are just small examples of very specific use cases. If you have any questions regarding how to integrate this functionality into your own domain, please don't hesitate to contact us at the email address [soporte@transparentedge.eu](mailto:soporte@transparetncdn.com).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.transparentedge.eu/config/i3/automatic-resizing.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
