diff options
author | Mattias Andrée <maandree@kth.se> | 2017-06-23 13:02:42 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@kth.se> | 2017-06-23 13:02:42 +0200 |
commit | b636cf4a899a90c45b545c866f394653513e96a1 (patch) | |
tree | 31b9274167b623ed8d0d4986a675d4429b753b34 /test.c | |
parent | CIEXYZ_TO_CIE1960UCS: set u and v to the limit if conversion results in division by zero (diff) | |
download | libcolour-b636cf4a899a90c45b545c866f394653513e96a1.tar.gz libcolour-b636cf4a899a90c45b545c866f394653513e96a1.tar.bz2 libcolour-b636cf4a899a90c45b545c866f394653513e96a1.tar.xz |
Fix nan in conversion from ciexyz to cieluv
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'test.c')
-rw-r--r-- | test.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -146,6 +146,10 @@ test_2convert_1n(libcolour_model_t model, const char *model_name, double ch1, do if (ch3 > 0.9999) return 1; /* fall through */ + case LIBCOLOUR_CIELUV: + if (ch1 <= 0.00001 && (ch2 > 0.00001 || ch3 > 0.00001)) + return 1; + /* fall through */ default: c1.srgb.R = ch1, c1.srgb.G = ch2, c1.srgb.B = ch3; break; |