"convert -edge" works OK in 32-bit build, wrong in 64-bit

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
tongro
Posts: 3
Joined: 2013-12-02T14:06:47-07:00
Authentication code: 6789

"convert -edge" works OK in 32-bit build, wrong in 64-bit

Post by tongro »

I can't find a way to upload sample images here, but the problem is fairly simple, so here goes.

I have a two-colour image consisting of black characters on a white background, and I want to convert it so that I get black character edges on a white background, or vice versa. So I run the command:

Code: Select all

convert in.png -edge 1 out.png
That works OK on my 32-bit computer, running the Debian Wheezy i386 build of ImageMagick 6.7.7.10-5. I get the edges in white on a black background, which is acceptable.

However, if I run the same command on the same image on my 64-bit computer, running the Debian Wheezy amd64 build of ImageMagick 6.7.7.10-5, the output is exactly the same (in pixels) as the input, which is not OK.

I'm certain this problem was not present on the 64-bit machine using older versions of ImageMagick, as the command is part of a script which used to work well, though I have no record of when it started failing.

So, is this a known bug? Has it been fixed in later versions? Is there a workaround for my particular task?

Thanks a lot.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: "convert -edge" works OK in 32-bit build, wrong in 64-bi

Post by snibgo »

You can put your images somewhere like dropbox.com, and paste the links here. Then someone can test your command on various versions of IM.
snibgo's IM pages: im.snibgo.com
tongro
Posts: 3
Joined: 2013-12-02T14:06:47-07:00
Authentication code: 6789

Re: "convert -edge" works OK in 32-bit build, wrong in 64-bi

Post by tongro »

User avatar
glennrp
Posts: 1147
Joined: 2006-04-01T08:16:32-07:00
Location: Maryland 39.26.30N 76.16.01W

Re: "convert -edge" works OK in 32-bit build, wrong in 64-bi

Post by glennrp »

Running "convert original.png -edge 1 output.png" on Ubuntu 12.04 LTS, on a 64-bit
machine, using freshly-built ImageMagick-6.8.7-8 gives the correct output.

convert -version
Version: ImageMagick 6.8.7-8 Q16 x86_64 2013-11-28 http://www.imagemagick.org
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: "convert -edge" works OK in 32-bit build, wrong in 64-bi

Post by snibgo »

On Windows 7 it works fine on a load of different versions, including the recent 6.8.7-5, except for v6.8.1-10 which copies the input unchanged to the output.
snibgo's IM pages: im.snibgo.com
User avatar
glennrp
Posts: 1147
Joined: 2006-04-01T08:16:32-07:00
Location: Maryland 39.26.30N 76.16.01W

Re: "convert -edge" works OK in 32-bit build, wrong in 64-bi

Post by glennrp »

IM-6.8.1-10 works for me on my 64-bit Ubuntu platform.
tongro
Posts: 3
Joined: 2013-12-02T14:06:47-07:00
Authentication code: 6789

Re: "convert -edge" works OK in 32-bit build, wrong in 64-bi

Post by tongro »

OK, thanks.

I've now worked around the problem, converting the input file to ASCII PBM, then (using Perl) manipulating the pixels directly. It was not too difficult, and runs quickly enough.
Post Reply