I am trying to compile Imagemagick 6.9.4-9 on solaris 10. There are 7 tests failing
FAIL: tests/cli-colorspace.tap 12
FAIL: tests/validate-formats-disk.tap 1
FAIL: tests/validate-formats-map.tap 1
FAIL: tests/validate-formats-memory.tap 1
FAIL: tests/wandtest.tap 1
FAIL: Magick++/demo/demos.tap 3
FAIL: Magick++/demo/demos.tap 6
I started to look at the first failure, ignoring the rest for now. The test 12 is about HSL <-> sRGB conversion.
If I run the test by hand, I get "137,80,146" which is not equal to the original value "146,89,80".
It turns out that the problem is in comparing double values in ConvertRGBToHSL
The function says:
Code: Select all
...
if (c <= 0.0)
{
*hue=0.0;
*saturation=0.0;
return;
}
if (max == (QuantumScale*red))
{
*hue=(QuantumScale*green-QuantumScale*blue)/c;
if ((QuantumScale*green) < (QuantumScale*blue))
*hue+=6.0;
}
else
...
Code: Select all
max == (QuantumScale*red)
I have replaced all the eqality comparisons with
Code: Select all
fabs(a-b) < 0.00001
Thank you
__
Vlad