Page 1 of 1

-shave and orientation

Posted: 2007-06-29T11:43:18-07:00
by jjg
Hi all

I have a rather strange problem: an image where -shave only shaves two sides, unless you rotate it first!

The following script

Code: Select all

#! /bin/sh
SHAVE=2x2
# version 
convert -v | head -n2
# file exhibiting bug
file bug.png
# only shaves two sides
convert -shave $SHAVE bug.png bug2.png
file bug2.png
# but if you rotate it first
convert -rotate 180 bug.png bug3.png
convert -shave $SHAVE bug3.png bug4.png
file bug4.png
when run with this image

Image

produces the following output
Version: ImageMagick 6.2.4 02/10/07 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2005 ImageMagick Studio LLC
bug.png: PNG image data, 344 x 40, 8-bit/color RGB, non-interlaced
bug2.png: PNG image data, 342 x 38, 8-bit/color RGB, non-interlaced
bug4.png: PNG image data, 340 x 36, 8-bit/color RGB, non-interlaced
am I missing something?

System is Debian Linux on x86.

Re: -shave and orientation

Posted: 2007-07-01T20:52:18-07:00
by anthony
I see no problems on my system How old is your IM?
We are about to release IM v6.3.5

NOTE you should read an image first, before trying to operate on it at least in IM v6.
Your technique is the old IM v5 way which was prone to undefined operator ordering problems.

Re: -shave and orientation

Posted: 2007-07-02T03:18:51-07:00
by jjg
Hi Anthony -- thanks for the reply

> I see no problems on my system How old is your IM?
> We are about to release IM v6.3.5

jjg> convert -v | head -n2
Version: ImageMagick 6.2.4 02/10/07 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2005 ImageMagick Studio LLC

This from Debian unstable

> NOTE you should read an image first, before trying to operate on it at least in IM v6.
> Your technique is the old IM v5 way which was prone to undefined operator ordering
> problems.

Thanks you for that hint -- I'll see if the "reading it first" fixes the problem which
prompted this report.

Cheers

Jim