[SOLVED] troubles rotating a square image

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
holden
Posts: 79
Joined: 2013-02-07T08:22:57-07:00
Authentication code: 6789

[SOLVED] troubles rotating a square image

Post by holden »

Hey all, I'm having issues rotating a perfectly square image to be composited onto a non-square surface- it doesn't want to rotate.

Code: Select all

convert -size 2100x1500 xc:white ( square.jpg -rotate 90 -resize x1350 -gravity center ) -composite foo.jpg
I've tried relocating the -rotate command to before and after gravity center and it still won't rotate (non-square images do though). Currently the only fix is to -rotate 90 before and after the -composite, which will over complicate things for me later on. Thanks!
Last edited by holden on 2013-05-16T12:24:57-07:00, edited 1 time in total.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: troubles rotating a square image

Post by fmw42 »

try

convert -size 2100x1500 xc:white ( square.jpg -rotate 90 -resize x1350 ) -gravity center -composite foo.jpg

What version of IM are you using and what platform. In unix parenthesis must be escaped as \( square.jpg -rotate 90 -resize x1350 \). In windows, that is not necessary. But there is a windows convert command also. So you must be sure you are using the IM convert

see
http://www.imagemagick.org/Usage/windows/
holden
Posts: 79
Joined: 2013-02-07T08:22:57-07:00
Authentication code: 6789

Re: troubles rotating a square image

Post by holden »

That is not working either- using IM 6.8.5.5
I'm on windows, but have yet to come across an issue with the convert command :o . I've had success with non-square images using this code, just a perfectly square image (362x362 in this case) doesn't want to rotate.
*edit* OK, now sans rotate it works. And it works in general - I am auto generating command files, I wonder if a space somewhere would mess things up. Thanks again IM team.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: [SOLVED] troubles rotating a square image

Post by fmw42 »

parenthesis must have spaces between them and the text commands
Post Reply