--- title: "Rotate image (Event action)" slug: "doc-rotate-image-actor" updated: 2026-04-02T06:30:46Z published: 2026-04-02T06:30:46Z canonical: "docs.lobstersoftware.com/doc-rotate-image-actor" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.lobstersoftware.com/llms.txt > Use this file to discover all available pages before exploring further. # Rotate image (Event action) *See also:* [Rotate image](/v1/docs/en/frebehav-rotate-image) (in forms) > [!NOTE] > Your title goes here > > **Purpose:** Creates a *target image* rotated by multiples of 90° clockwise or counter-clockwise from an *original image* in the same file format. > > > [!TIP] > > Tooltip > > > > - **Usage:** The 'Input image' is defined by a value resolver. The image information rotated by the 'Angle' is stored as defined by the 'Result image' value resolver. > > - **Parameter:** Angle (value resolution for a positive or negative rotation angle in degrees), Input image (value resolution for original image), Result image (value resolution for the target to save the rotated image). > > - **Output:** Data of the rotated image in a selectable storage location (field, file, variable, etc.). > > - **WARNING:** Write accesses to files via the 'Result image' value resolver are also executed in test mode. --- **NOTE:** *This event action is only available, if the functional extension module 'Document Management' is installed and licensed.* --- The [Rotate image (Event action)](/v1/docs/en/doc-rotate-image-actor) creates a *target image* in the same file format, rotated clockwise or counter-clockwise by multiples of 90°, starting from an *original image*. The file formats JPEG, PNG, BMP and GIF are supported. **NOTE:** Depending on the graphic format, compressed image data may be unpacked for rotation and then compressed again. Since the compression for the target data does not have to match the compression of the original data, the amount of data in the image may change. Even with a rotation of 0° or 360°, this can cause the image information to deviate from the original. ## Configuration | The **Angle** parameter requires negative or positive integers, rounded to multiples of 90, to indicate the angle of rotation to be applied: - Positive values (>45°) define a clockwise rotation. - Negative values (<-45°) define a counter-clockwise rotation. - For example, a rotation angle of -90° is equivalent to a rotation angle of 270°. The **Input image** parameter must provide the *original image* via a value resolver whose return value corresponds to the 'action event content' or 'byte array' type. The **Result image** parameter defines where the *target image* should be saved to. The value resolver must define a suitable 'recipient' here (e.g. a variable or an object field) for a 'byte array' or the 'action event content' type. | ![images/download/attachments/177907546/image-2024-8-12_9-47-39-version-1-modificationdate-1723448858727-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/image-2024-8-12_9-47-39-version-1-modificationdate-1723448858727-api-v2.png) | | --- | --- | **NOTE:** Often the *original image* is available as an uploaded file and the *target image* should also be saved as a new file or overwrite the original file. Then a [File reference](/v1/docs/en/core-file-reference-content-builder) value resolver can be used for the **Input image** and **Result image** value resolvers respectively, which enables read and write operations in the server-side file system. **CAUTION****:** If a [File reference](/v1/docs/en/core-file-reference-content-builder) value resolver is used for the **Result image** parameter, this requires a write access in the file system by which existing files can be overwritten or deleted without query. **This is particularly critical, since corresponding write accesses to the file system are executed without restriction even in test mode.** **CAUTION****:** If the return value of the parameter **Input image** content is provided in an unsuitable file format, 'No value' (`null`) is output as the *target image*. **In conjunction with a file reference value resolver for the Result image parameter, the referenced file is then deleted!** In contrast to this, an assignment of null, e.g. to the `documentContent` field of a document (see [Documents](/v1/docs/en/doc-document)), simply has no effect. ## Example With the [Change profile picture](/v1/docs/en/gui-user-menu-settings-avatar) function, [Users](/v1/docs/en/base-user) can define a personal 'profile picture', the so-called 'avatar', for the context of **Lobster Data Platform/Orchestration**, which can be edited a little with regard to zoom level and rotation directly after uploading. Subsequent changes for an already uploaded profile picture, on the other hand, are not provided for by default. To demonstrate the [Rotate image (Event action)](/v1/docs/en/doc-rotate-image-actor) event action, a function is set up to rotate the already uploaded profile image for an existing user account. For this purpose, two buttons are provided in the [Users](/v1/docs/en/base-user) overview of the ribbon, which rotate the respective profile picture by 90° to the left or right in combination with a single selection for a user account. Runtime example: ![images/download/attachments/177907546/image2021-5-18_18-21-37-version-1-modificationdate-1723110202239-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/image2021-5-18_18-21-37-version-1-modificationdate-1723110202239-api-v2.png) - These two buttons are intended to allow the 'Avatar' to be rotated to the left or right when a specific user is selected. Configuration: For each of the two menu commands an [Custom action event](/v1/docs/en/core-custom-action-events) is set up, which is to be triggered by the respective button (see [Ribbon macros](/v1/docs/en/ribbon-macros) or [Available commands](/v1/docs/en/ribbon-commands)/'Custom action event'). | A common event handling for the two **Triggering events** 'Rotate Left' (`ROTATE_LEFT`) and 'Rotate Right' (`ROTATE_RIGHT`) is created and configured as shown on the right: - The **Validating rule** uses [Check type](/v1/docs/en/core-check-type-rule) to ensure that a 'user' account is present as an *input object* in the data context of event handling. **NOTE:** Here, the field `avatarURL` could additionally be checked for 'not empty' with an [Entity property rule](/v1/docs/en/core-entity-property-rule) to ensure that a profile picture was uploaded for this user at all. --- The **Actions on passed rule** is passed are first presented here in an overview. Details per action follow below: - A [Set value](/v1/docs/en/core-set-value-actor) event action defines the file path where the user's profile picture can be found as the value of the variable `avatarFilePath`. - Within an [If then else](/v1/docs/en/core-if-then-else-actor) event action, the `rotation` variable is assigned the desired rotation angle (-90° for left rotation, 90° for right rotation). - Finally, the event action [Rotate image (Event action)](/v1/docs/en/doc-rotate-image-actor) follows: - The value for the **Angle** parameter is taken directly from the `rotation` variable. - For the **Input image** and **Result image** parameters, the text value from the `avatarFilePath` variable is used as the **File path** in a [File reference](/v1/docs/en/core-file-reference-content-builder) value resolver in each case. The read access for the **Input image** and the write access for the **Result image** here exceptionally concern the same file. This is therefore overwritten when a rotation is executed. **NOTE:** By default, the profile picture does not appear to be visible in the details for the selected user account. The rotated image will not appear until the next time the user in question logs in. Even if the profile picture of the logged-in user is rotated, it does not appear immediately in the top left corner of the user area of the menu bar in the existing session. **NOTE:** The rotation overwrites the file referenced in the user account. Nothing changes in the reference in the user account. In this respect, the change takes effect without saving the user account. | ![images/download/attachments/177907546/image-2024-8-12_9-51-26-version-1-modificationdate-1723449086094-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/image-2024-8-12_9-51-26-version-1-modificationdate-1723449086094-api-v2.png)![images/download/attachments/177907546/image-2024-8-12_9-54-5-version-1-modificationdate-1723449245103-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/image-2024-8-12_9-54-5-version-1-modificationdate-1723449245103-api-v2.png) | | --- | --- | Configuration details: | The first [Set value](/v1/docs/en/core-set-value-actor) event action assigns the file path to the profile picture of the user present as *input object* to the `avatarFilePath` variable: - The `avatarURL` [Object property](/v1/docs/en/core-property-resolver) contains a URL that points to the user's profile picture, if one is currently uploaded. Since a relative file path for the server's file system is required instead of the URL, the URL is prepared in two steps by concatenated [Replace text](/v1/docs/en/core-replace-string-resolver) value resolvers. - First, the `img://` prefix is replaced with the relative path to the server's public directory (in a default installation `./upload/web/`). - After that, the parameter part of the URL introduced with a question mark is removed, which enables the **Regular expression?** option. Runtime example: `avatarURL="img://avatar/user_avatar_101.png?c=1619013361517"` results (correspondingly) `avatarFilePath="./upload/web/avatar/user_avatar_101.png"` | ![images/download/attachments/177907546/image-2024-8-12_9-57-7-version-1-modificationdate-1723449426587-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/image-2024-8-12_9-57-7-version-1-modificationdate-1723449426587-api-v2.png) | | --- | --- | | The following case distinction per [If then else](/v1/docs/en/core-if-then-else-actor) event action shall define the rotation angle for either left or right rotation depending on the ribbon button pressed at runtime. - Within an [Entity property rule](/v1/docs/en/core-entity-property-rule), this is done by comparing the return value of the value resolver [Triggering event](/v1/docs/en/core-caused-event-resolver) with the value of the dynamic enumeration [Custom action event](/v1/docs/en/core-custom-action-events) (see [Static values](/v1/docs/en/core-literal-value-resolver), 'Any dynamic enumeration'), which defines the 'Rotate Left' event. - IF is assumed when the [Triggering event](/v1/docs/en/core-caused-event-resolver) is determined as 'Rotate left', then the variable `rotation` is assigned the value -90. - ELSE is assumed when the [Triggering event](/v1/docs/en/core-caused-event-resolver) is 'Rotate right', since no other triggering events are defined for event handling. Then, without an explicit check (*not expanded in the image*), the `rotation` variable is assigned the value 90 for the clockwise rotation. | ![images/download/attachments/177907546/image-2024-8-12_10-0-55-version-1-modificationdate-1723449654743-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/image-2024-8-12_10-0-55-version-1-modificationdate-1723449654743-api-v2.png) |