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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Automate
Unanswered

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,974 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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 538 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard