---
title: "resize · RUAL Documentation"
description: "resize given images with new dimensions"
canonical: https://docs.rual.nl/block-types/files/function_resize_image
language: en
---

# resize

This block is part of the [`files`](https://docs.rual.nl/block-types/files) group and was last modified in core [`v13.0.5`](https://docs.rual.nl/core-versions/130005).

resize given images with new dimensions

- flow `flow`

- Files required `v10.5.10` `file` The files to be resized. The resize will create new files and not overwrite the old ones.

- Width `number` The new width in pixels. Leave empty to auto-scale the height

- Height `number` The new height in pixels. Leave empty to auto-scale the width

- Quality `number` The quality of the file (1-100)

- Fit `value` Default: cover. Options: cover, contain, fill, inside, outside

- Position `value` Can only be used with fit cover or contain. Default: centre. Options: top right top, right, right bottom, bottom, left bottom, left, left top, centre

- options `v13.0.5` `object` Sharp options to be used during resize.

- flow `flow`

- Resized files `v10.5.10` `file`

- Success `condition` True if all images succeeded. False if one or more images are failing

- Errors `array` Error messages

- Failed `v10.5.10` `file` Files which were not resized.

[get file from assets](https://docs.rual.nl/block-types/files/file_from_assets) loads a stored image, [resize](https://docs.rual.nl/block-types/files/function_resize_image) scales it to the width pin, and [get image size](https://docs.rual.nl/block-types/files/file_get_image_size) reads the resulting width back, which is stored in a variable with [set number var](https://docs.rual.nl/block-types/number/number_create_variable_from_value). The flow runs from a [function trigger](https://docs.rual.nl/block-types/globals/trigger_custom_function), the file pins carry the image between the blocks.

![Studio canvas example for the resize block: resizing an image from assets.](https://docs.rual.nl/canvas-examples/function_resize_image.png)

### Commonly used with

In production blueprints, this block is most often wired together with:

- [number](https://docs.rual.nl/block-types/number/number_default): feeds into this block. Generates a valid number from the filled custom value in the blueprint.

- [branch](https://docs.rual.nl/block-types/flow/branch): wired in both directions with this block.

- [rename](https://docs.rual.nl/block-types/files/file_rename): wired in both directions with this block. Renames the given files.

- [value](https://docs.rual.nl/block-types/value/value_default): feeds into this block. Simply returns the provided value.

- [move to public](https://docs.rual.nl/block-types/files/file_move_public): feeds into this block. Moves the given files to a new public destination.

- [get link](https://docs.rual.nl/block-types/files/file_get_link): this block feeds into it. Returns the link of a given file which can be used as a img src. Will only work with public files.

### Used in these guides

These documentation pages use or explain this block:

- [Assets](https://docs.rual.nl/blueprints/assets)

### Version history

Introduced in [`v13.0.5`](https://docs.rual.nl/core-versions/130005).
