Strange compose behaviour

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
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Strange compose behaviour

Post by fmw42 »

I suspect the issue is that you are rotating the images as their widths are less than their heights. This means that the size specification in your -geometry has the rotated widths and heights backwards. You need to switch them. Of course this causes a problem when your images are not rotated. So you are probably better off doing a test before hand and then making two convert statements depending upon whether the image is rotated or not.

As a quick test, take out the rotation and see if the results are placed correctly.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Strange compose behaviour

Post by anthony »

Alturnativally resize your images before rotating!!!!

Also -rotate in your example is rotating not only the image, but the canvas on whcih the image has been composed. The -geometry resize is limited to just the last image but it is the ONLY image operator that has that limitation, and that was due to backward compatibility reasons. -rotate has no such limitation, it rotates ALL images that are currently in memory!!!
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply