crop height xor width inconsistency

Discuss the conjure program and the Magick Scripting Language (MSL) here. MSL is an XML-based wrapper to the ImageMagick image-processing functions.
Post Reply
docjones2
Posts: 11
Joined: 2011-07-27T15:42:04-07:00
Authentication code: 8675308

crop height xor width inconsistency

Post by docjones2 » 2011-07-28T11:33:15-07:00

This problem involves specifying a single dimension for <crop> (height or width but not both)

consider

Code: Select all

<crop geometry='x250'/>
it will create and image with a height of 250 and the original width.

however

Code: Select all

<crop geometry='250x'/>
will not create an image with a width of 250 and the original height. Instead it will instead create a square 250x250 image. If this geometry is passed to ParseGravityGeometry, it will also cause gravity to be ignored.

On the command line the correct bahaviour applies.

Setting attribute height xor width instead of using geometry will produce correct output

EDIT:
I see in msl.c

Code: Select all

if ((flags & HeightValue) == 0)
                        geometry.height=geometry.width;

So it would appear that this is in fact the intended behaviour, however it is still inconsistent with the command line.

User avatar
magick
Site Admin
Posts: 10690
Joined: 2003-05-31T11:32:55-07:00

Re: crop height xor width inconsistency

Post by magick » 2011-07-28T12:00:51-07:00

We'll get a patch into ImageMagick 6.7.1-1 Beta within a day or two to fix the bug. Thanks.

Post Reply