rotate zoom - broke after update

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
dognose
Posts: 265
Joined: 2005-03-08T22:16:37-07:00

rotate zoom - broke after update

Post by dognose »

I'm using this command to rotate and zoom in on an image.

convert image.jpg -background transparent -gravity center -scale 200% -rotate 45 -crop800x600+0+0 -trim +repage out.jpg

It works in IM 6.7.2-7
but with IM 6.7.8-9 it no longer holds to the center of the image and the image is cropped weird.

What changed in the update, and how do I fix it?

Input - Output and output bad..

https://imgur.com/a/z2YBpAf
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: rotate zoom - broke after update

Post by fmw42 »

IM 6.7.8.9 was during major changes to Imagemagick that did not finish until about 6.8.5.x. So I would upgrade to a higher version. If you are on Linux, then the version number is not as important as the version date, since Linux does not always change the version number when they patch.

Try putting +repage after the crop and after the trim. If that does not help, then you really need to upgrade
dognose
Posts: 265
Joined: 2005-03-08T22:16:37-07:00

Re: rotate zoom - broke after update

Post by dognose »

The added +repage after the rotate seems to have fixed it.

I've also tried this on IM 7.0.8, and it had the same problem. (Still trying to figure out what all else has changed with that update. )
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: rotate zoom - broke after update

Post by fmw42 »

The proper syntax has always been to add +repage after a crop or after a trim. IM 6 is more forgiving or syntax issues. IM 7 is very strict about using proper syntax.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: rotate zoom - broke after update

Post by snibgo »

The need for "+repage" has changed over the years, mostly because canvas dimensions and offsets have become more logical. A recent change is that "-append" and "+append" take the canvas from the first image, so we now often need "+repage" afterwards.
snibgo's IM pages: im.snibgo.com
Post Reply