-shave and orientation

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
jjg

-shave and orientation

Post 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.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: -shave and orientation

Post 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.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
jjg

Re: -shave and orientation

Post 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
Post Reply