Problem rotate to .png

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
VladimirR
Posts: 2
Joined: 2013-04-10T10:27:52-07:00
Authentication code: 6789

Problem rotate to .png

Post by VladimirR »

Code: Select all

convert.exe tmp3.png -rotate 30 rotate.png
This command rotates the image, but the image boundaries are after rotation not identical with the layer boundary. Observed in version 6.8.3 and 6.8.4, both version Windows x32 and x64.

Rotate to another format (I tested .jpg and .gif) works without layer moving.

Old version 6.6.4 works without any problems, other versions I do not know.

Image

(Sorry for my English)
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Problem rotate to .png

Post by snibgo »

You can use "+repage":

Code: Select all

convert.exe tmp3.png -rotate 30 +repage rotate.png
snibgo's IM pages: im.snibgo.com
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Problem rotate to .png

Post by anthony »

That just essentially removes the 'offset' of the rotated image.

-rotate is probably not using Distort correctly. This was a relativity recent change.

It should be calling SRT 0 with no virtual (+distort) flag.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
VladimirR
Posts: 2
Joined: 2013-04-10T10:27:52-07:00
Authentication code: 6789

Re: Problem rotate to .png

Post by VladimirR »

snibgo wrote:You can use "+repage":

Code: Select all

convert.exe tmp3.png -rotate 30 +repage rotate.png
Thank you, it works. As a fallback solution is sufficient.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Problem rotate to .png

Post by anthony »

Okay rotate does seem to be working correct. Though it does seem to try and preserve the images virtual offset for a rotation of the image about the image's 'center' point. That means the a typical image may end up with a negative offset.

This can be good (for image layering) and back (when not image layering) but the solution

In that it is equivalent to
-virtual-pixel background +distort SRT {angle}
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply