Page 1 of 1

[SOLVED] troubles rotating a square image

Posted: 2013-05-16T11:50:00-07:00
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!

Re: troubles rotating a square image

Posted: 2013-05-16T12:04:56-07:00
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/

Re: troubles rotating a square image

Posted: 2013-05-16T12:14:38-07:00
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.

Re: [SOLVED] troubles rotating a square image

Posted: 2013-05-16T12:32:29-07:00
by fmw42
parenthesis must have spaces between them and the text commands