Skip to main content

Notifications

Community site session details

Community site session details

Session Id : mCKzFpGHqhb/pmb8ZD9NmV
Power Automate - Power Automate Desktop
Answered

Rotate Images

Like (0) ShareShare
ReportReport
Posted on 17 Aug 2022 10:35:57 by 570

Does anyone have any idea how to rotate images in a folder using a PowerShell script? I'm working on an OCR flow that converts PDFs to images to OCR scan for data to be used in the renaming and moving of the PDFs. The OCR does not seem to work on images rotated 90 degrees. Think of a landscape page scanned as a portrait. So any remaining images after my flow will need to be rotated. I can achieve this through UI manipulation, but I was hoping for a more efficient way.

  • Suggested answer
    takolota1 Profile Picture
    4,863 Super User 2025 Season 1 on 27 Mar 2025 at 02:00:15
    Rotate Images
    If you use the AI Builder OCR Recognize text in an image or pdf then there are ways to manipulate that data so it always reads the text as up-right.
     
    I show an example of how to do this in this extract data from pdfs template: https://community.powerplatform.com/galleries/gallery-posts/?postid=31e67eea-3f73-47b4-95b7-fe4a7b646389
  • Verified answer
    Kaif_Siddique Profile Picture
    2,104 Super User 2024 Season 1 on 17 Aug 2022 at 19:29:18
    Re: Rotate Images

    Hi Jason,

     

    Please refer the below PowerShell script to rotate multiple images in a specific folder:

    --------------------------------------------------------------------------------

    $path = "FOLDER PATH" #target directory

    [System.Reflection.Assembly]::LoadWithPartialName("System.Drawing")
    Get-ChildItem -recurse ($path) -include @("*.png", "*.jpg") |
    ForEach-Object {
    $image = [System.Drawing.image]::FromFile( $_ )
    $image.rotateflip("Rotate90FlipNone")
    $image.save($_)
    }

    --------------------------------------------------------------------------------

     

    Hope this will help.

     

    Regards

    Kaif

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Automate - Power Automate Desktop

#1
eetuRobo Profile Picture

eetuRobo 64 Super User 2025 Season 1

#2
Nived_Nambiar Profile Picture

Nived_Nambiar 18 Super User 2025 Season 1

#3
CU12050101-0 Profile Picture

CU12050101-0 12

Overall leaderboard
Loading started