How to Rotate Images in Power Automate
In a large enterprise integration platform like Power Automate, it’s easy to make changes to files at scale. We can simply load files from a target folder into our flow and process each file individually with a value-add connector action.
In this article, we’ll build a Power Automate flow that uses the Cloudmersive Image Processing connector to rotate images a specific number of degrees (between 0.0–360.0). We’ll apply one rotation angle across several files in a target folder, ensuring all our images experience a uniform change before they’re utilized for another purpose.
We’ll select the option to create an instant cloud flow so we can put our key action in play with full control over our data.
To get our image files from the folder they live in, we’ll either use a List files in folder (OneDrive) or List folder (SharePoint) action. I’ll be using the former option in my example flow.
Next, we’ll add a Get file content action into our flow. We’ll configure this action to consume the File identifier (Id) value retrieved from our List files in folder or List folder action.
We’ll notice Power Automate automatically wrapped our Get file content action in a For each control to ensure it runs through each file in the Id array.
Within that For each control, we’ll add our image rotation action. To find it, we’ll search for Cloudmersive connectors, and we’ll scroll down until we locate the Cloudmersive Image Processing connector with the green logo.
We’ll click “See more” to view the actions list, and from there, we’ll search for an action titled Rotate an image any number of degrees. The actions list is arranged alphabetically, so we’ll find this action towards the bottom of the list.
After we select it, we’ll need to create our connection before we can begin configuring our request parameters. To do that, we’ll need a Cloudmersive API key, which we can get by creating a free account on the Cloudmersive website. This will allow us to make up to 800 API calls per month with zero additional commitments.
Once we’re ready to customize our request, we’ll add our desired rotation angle in the initial Degrees to rotate parameter. In my example, I’ll be rotating my images by 90.0 degrees. Right after that, we’ll add our file content and file names into the following two parameters.
In the final step of our flow, we’ll add a Create file action within the For each control. We’ll use this action to write the rotated versions of our image files to the same folder they originally came from. To distinguish these file names from the original file names, we’ll add a string (e.g., “Rotated 90”) to the Display name value. We’ll use the Body response from our Rotate an image action to define the content of our rotate image files.
Now we’ll save and test our flow. It’s worth noting that image processing flows can take a minute or two to run — especially if we’re working on large, detailed image files.
In our target folder, we’ll find the rotated versions of all our initial images next to the originals. Just like that, we can easily create custom image rotations at scale — without writing any code!