web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Automate
Answered

Rotate Images

(0) ShareShare
ReportReport
Posted on by 572

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.

I have the same question (0)
  • Verified answer
    Kaif_Siddique Profile Picture
    2,108 Super User 2024 Season 1 on at

    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

  • Suggested answer
    takolota1 Profile Picture
    4,980 Moderator on at
    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

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 557

#2
Valantis Profile Picture

Valantis 328

#3
David_MA Profile Picture

David_MA 264 Super User 2026 Season 1

Last 30 days Overall leaderboard