Re: possible bug in -border X% in IM 6.7.8.6 Q16
Posted: 2012-08-02T16:08:41-07:00
I downloaded ImageMagick-6.7.8-8.tar.bz2 02-Aug-2012 14:47, but do not see what I would have expected. Perhaps it has not made it into the available beta at this time.magick wrote:The patch is available now. Give it a try.
Here are my tests and what I would like to see happen, which depends upon whether an "x" is specified. It gives the most flexible options that I can think of.
For pixel units:
1) if one value and no x, apply the pixel value equally to W and H [this would then be the same as 3) below]
2) if one value and x supplied, then apply the pixel value only to W or H dimension specified with the x
3) if two values (separate by x), then apply those pixel values separately to W and H
imb convert -size 100x300 xc:white -bordercolor black -border 5 -format "%w x %h" info:
110 x 310 --> this is correct
imb convert -size 100x300 xc:white -bordercolor black -border 5x -format "%w x %h" info:
110 x 310 --> this would then become 110x300 so similar in behavior to x5 just below
imb convert -size 100x300 xc:white -bordercolor black -border x5 -format "%w x %h" info:
100 x 310 --> this is correct
imb convert -size 100x300 xc:white -bordercolor black -border 5x5 -format "%w x %h" info:
110 x 310 --> this is correct
For percent units:
1) if one value and no x, convert the given percent to pixels separately for W and H and apply to each dimension appropriately [this would then be the same as 3) below]
2) if one value and x supplied, convert the percent to pixels using the given dimensions specified by the x and apply that pixel value to both dimension.
3) if two values (separate by x), convert the given percents to pixels separately for W and H and apply to each dimension appropriately
imb convert -size 100x300 xc:white -bordercolor black -border 5% -format "%w x %h" info:
110 x 330 --> this is correct
imb convert -size 100x300 xc:white -bordercolor black -border 5x% -format "%w x %h" info:
110 x 310 --> this is correct
imb convert -size 100x300 xc:white -bordercolor black -border x5% -format "%w x %h" info:
300 x 330 -- this should be 130 x 330 so similar in behavior to 5x% just above
imb convert -size 100x300 xc:white -bordercolor black -border 5x5% -format "%w x %h" info:
110 x 330 -- this is correct
Alternately, make 5 and 5x be the same as 5x above and similarly 5% and 5x% be the same as 5x% above.
Anthony and Draoidh, what do you guys think?