diff options
author | Marti Maria <marti.maria@littlecms.com> | 2023-05-16 16:32:42 +0200 |
---|---|---|
committer | Marti Maria <marti.maria@littlecms.com> | 2023-05-16 16:32:42 +0200 |
commit | e55b6fa4d3c5b7e08d9e4bc8c803a79ca908b5a4 (patch) | |
tree | b36fdc835152ea9e9a6e25948fb1df88ae230b74 /plugins/fast_float/testbed | |
parent | f087232ced02e34c36b88e9d75d071aa46fec0ff (diff) | |
download | lcms2-master.tar.gz |
Thanks to ISOZAKI Nozomi to point out the issue.
Diffstat (limited to 'plugins/fast_float/testbed')
-rw-r--r-- | plugins/fast_float/testbed/fast_float_testbed.c | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/plugins/fast_float/testbed/fast_float_testbed.c b/plugins/fast_float/testbed/fast_float_testbed.c index f00b4cf..5e4fb4d 100644 --- a/plugins/fast_float/testbed/fast_float_testbed.c +++ b/plugins/fast_float/testbed/fast_float_testbed.c @@ -1142,10 +1142,33 @@ void CheckLab2Roundtrip(void) } +static +void CheckAlphaDetect(void) +{ + cmsHPROFILE hsRGB; + cmsHTRANSFORM xform; + + cmsSetLogErrorHandler(NULL); + + hsRGB = cmsCreate_sRGBProfile(); + + xform = cmsCreateTransform(hsRGB, TYPE_RGB_FLT, hsRGB, TYPE_RGBA_FLT, INTENT_PERCEPTUAL, cmsFLAGS_COPY_ALPHA); + cmsCloseProfile(hsRGB); + + if (xform != NULL) + Fail("Copy alpha with mismatched channels should not succeed"); + + cmsSetLogErrorHandler(FatalErrorQuit); +} + // Convert some known values static void CheckConversionFloat(void) { + trace("Check alpha detection."); + CheckAlphaDetect(); + trace("Ok\n"); + trace("Crash test."); TryAllValuesFloatAlpha(cmsOpenProfileFromFile(PROFILES_DIR "test5.icc", "r"), cmsOpenProfileFromFile(PROFILES_DIR "test0.icc", "r"), INTENT_PERCEPTUAL, FALSE); @@ -1186,6 +1209,8 @@ void CheckConversionFloat(void) TryAllValuesFloatVs16(cmsOpenProfileFromFile(PROFILES_DIR "test0.icc", "r"), cmsOpenProfileFromFile(PROFILES_DIR "test0.icc", "r"), INTENT_PERCEPTUAL); TryAllValuesFloat(cmsOpenProfileFromFile(PROFILES_DIR "test0.icc", "r"), cmsOpenProfileFromFile(PROFILES_DIR "test0.icc", "r"), INTENT_PERCEPTUAL); trace("Ok\n"); + + } @@ -2470,7 +2495,7 @@ int main() trace("Installing plug-in ... "); cmsPlugin(cmsFastFloatExtensions()); trace("done.\n\n"); - + CheckComputeIncrements(); // 15 bit functionality |