Discussion:
Strange Inverse Result [OSX Snow Leopard]
Billy Bo
2009-10-10 14:29:52 UTC
Permalink
(BUG FOUND ON OSX SNOW LEOPARD - unconfirmed on other platforms)
When using this command:
convert -background black -fill white -font Arial -pointsize 100 label:+ test.tiff
I get a result that is unexpected. The + symbol is black and the background is white. (inverted)
If I try the same command but use PNG instead of TIFF, then the result is as expected and not inverted.
I tested this further by writing a script that looped through parts of the ASCII table converting each letter to a file. When using TIFF format, although most of the characters were correct, some symbols were inverted. These include: + | = - _
I hope this helps, thanks.
d***@imagemagick.org
2009-10-10 15:27:58 UTC
Permalink
Post by Billy Bo
The + symbol is black and the background is white
Which version of ImageMagick are you using? Which version of TIFF? We're
using ImageMagick 6.5.6-10 and libtiff 3.9.1 and we get the expected results,
black background and a white +.
Ryan Schmidt
2009-10-11 00:25:31 UTC
Permalink
On Oct 10, 2009, at 10:27,
Post by d***@imagemagick.org
Post by Billy Bo
The + symbol is black and the background is white
Which version of ImageMagick are you using? Which version of TIFF?
We're
using ImageMagick 6.5.6-10 and libtiff 3.9.1 and we get the expected results,
black background and a white +.
I am the maintainer of ImageMagick in MacPorts and I am able to
reproduce the issue with ImageMagick @6.5.6-1_0+q8+universal and
@6.5.6-10_0+q8+universal on Snow Leopard (with tiff @3.9.1_0+macosx
+universal). On my machine, ImageMagick and all its dependencies are
built universal, for x86_64 and i386.

Perhaps building universal is the problem. Billy, are you building
with the universal variant as well? If so, you could try rebuilding
everything without it. I have not yet had a chance to test without it.

If universal is the issue, maybe ImageMagick or tiff or one of the
other dependencies is trying to detect the bit size at configure time
(which wouldn't work right since configure is run only once and then
serves both architectures) instead of using __LP64__ #defines at build
time (which would work fine). If we find which software is doing this,
we could also switch it to use the muniversal portgroup in MacPorts,
which configures and builds for each architecture separately instead
of together, and then merges the result. This method sometimes has its
own set of issues, however. FYI, tiff is already using muniversal in
MacPorts.
Ryan Schmidt
2009-10-11 13:45:52 UTC
Permalink
Post by Ryan Schmidt
I am the maintainer of ImageMagick in MacPorts and I am able to
@6.5.6-10_0+q8+universal on Snow Leopard (with tiff @3.9.1_0+macosx
+universal). On my machine, ImageMagick and all its dependencies are
built universal, for x86_64 and i386.
Perhaps building universal is the problem. Billy, are you building
with the universal variant as well? If so, you could try rebuilding
everything without it. I have not yet had a chance to test without it.
I also see the problem on Snow Leopard if ImageMagick and all
dependencies are built for x86_64 only (the default on Snow Leopard),
or for i386 only. So I can't seem to make the problem go away on Snow
Leopard no matter how I build ImageMagick.

I also see the problem on Leopard if ImageMagick and all dependencies
are built universal for x86_64 and i386.

In all the above cases, "convert" produces this one line of output:

convert: unable to read font `Arial' @ annotate.c/RenderType/806.


I don't see the problem on Leopard if ImageMagick is built for i386
only (the default on Leopard) -- but in that case, though the colors
are now right, the "+" looks different (is a different font maybe).

In this case, "convert" produces these six lines output:

convert: unable to read font `Arial' @ annotate.c/RenderType/806.
convert: unable to read font `/mp/lib/ImageMagick-6.5.6/config//mp/
share/ghostscript/fontsx/n019003l.pfb' @ annotate.c/RenderFreetype/1042.
convert: unable to read font `Arial' @ annotate.c/RenderType/806.
convert: unable to read font `/mp/lib/ImageMagick-6.5.6/config//mp/
share/ghostscript/fontsx/n019003l.pfb' @ annotate.c/RenderFreetype/1042.
convert: unable to read font `Arial' @ annotate.c/RenderType/806.
convert: unable to read font `/mp/lib/ImageMagick-6.5.6/config//mp/
share/ghostscript/fontsx/n019003l.pfb' @ annotate.c/RenderFreetype/1042.

Note: This was a mixed installation; some of the dependencies were
already universal, so this test was not ideal. I can retry later in a
pure i386 environment. I can also still try a pure x86_64 environment
on Leopard. For something completely different, I could also check 32-
bit ppc builds on Leopard and Tiger.
William Kitching
2009-10-10 15:56:45 UTC
Permalink
Version: ImageMagick 6.5.6-1 2009-10-09 Q16

Sorry I'm not sure how to query the version of libtiff.
d***@imagemagick.org
2009-10-10 16:29:37 UTC
Permalink
Post by William Kitching
Sorry I'm not sure how to query the version of libtiff
identify -list format
William Kitching
2009-10-10 18:05:21 UTC
Permalink
Post by d***@imagemagick.org
identify -list format
Thanks for the tip, the version is:

Tagged Image File Format (LIBTIFF, Version 3.9.1)
Billy Bo
2009-10-14 14:55:36 UTC
Permalink
I've just managed to test my issue on a Windows XP machine. The problem here seems worse.
Running the same command but using the letter 'A' instead of '+' renders a completely black image.
Further testing proves that more symbols render out a black image. If I change the output format to PNG, the result is correct.
I hope this helps.Thanks.
Version: ImageMagick 6.5.6-10 2009-10-08 Q16
Command: convert -background black -fill white -font Arial -pointsize 40 label:A test.tiff
Loading...