Rotating an image

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
arobin4
Junior Coder
Posts: 33
Joined: Sat Apr 07, 2012 5:41 am

Rotating an image

Post by arobin4 » Sun Apr 22, 2012 5:18 am

Hi Forum:

I am look for a way to rotate an image, 'X' degrees; where 'X' is any variable number between 0-360. I could not find a direct property for this. Any ideas on how it can be accomplished?

Thanks

Me_again
Automation Wizard
Posts: 1101
Joined: Fri Jan 07, 2005 5:55 pm
Location: Somewhere else on the planet

Post by Me_again » Sun Apr 22, 2012 9:33 pm

IMHO the best way to manipulate images with MacroScheduler is to automate the command line mode of ImageMagick. A very simple script to rotate an image by a defined number of degrees (221 in the example) and and save to a new file would be:

Code: Select all

Let>RP_WINDOWMODE=0
Let>rot=221
Run program>c:\imag\convert.exe -rotate %rot% c:\stuff\rottest.gif c:\stuff\rottest%rot%.gif
Image rotation is a complex subject and ImageMagick has other features that can help with issues like distortion (jaggies), and how to handle the blank spaces that result when an image is rotated by a non multiple of 90 degrees - but an imagemagick/graphics forum would be the place for that discussion.

arobin4
Junior Coder
Posts: 33
Joined: Sat Apr 07, 2012 5:41 am

Post by arobin4 » Mon Apr 23, 2012 3:40 am

Me_again,
Thanks for telling me about ImageMagick. Question: Can the function of rotating an image be compiled into standalone code along with the macro script? My objective is to compile the script to run on machines without ImageMagick and Macro Scheduler locally installed.

Thanks again.

Me_again
Automation Wizard
Posts: 1101
Joined: Fri Jan 07, 2005 5:55 pm
Location: Somewhere else on the planet

Post by Me_again » Tue Apr 24, 2012 1:33 am

No, you can't do that.

arobin4
Junior Coder
Posts: 33
Joined: Sat Apr 07, 2012 5:41 am

Post by arobin4 » Tue Apr 24, 2012 1:58 am

Okay thanks for the response Me_again.

mileswilliams
Junior Coder
Posts: 24
Joined: Sun Jun 11, 2006 9:50 am

I think you could, but...

Post by mileswilliams » Wed May 02, 2012 10:01 pm

Instead of distributing a copy of imagemagik or whatever it is called, why not give everyone a copy of a macro that ftps the file to a server where you have the app, a macro there will check the directory and rotate the image and send it back. Job done. None of that is very hard either if you break it down and hammer the help files :-)
don't be a chicken little

Me_again
Automation Wizard
Posts: 1101
Joined: Fri Jan 07, 2005 5:55 pm
Location: Somewhere else on the planet

Post by Me_again » Thu May 03, 2012 4:29 pm

It may be possible to do it completely in macroscheduler as the OP wanted. Apparently vbscript can rotate images, and macroscheduler includes vbscript.

arobin4
Junior Coder
Posts: 33
Joined: Sat Apr 07, 2012 5:41 am

Post by arobin4 » Thu May 10, 2012 2:04 am

Thanks Me_again, I will try this out.

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts