Thread: [Lcms-user] [Release candidate] Little CMS 2.13 is ready to be released
An ICC-based CMM for color management
Brought to you by:
mm2
From: Marti M. <mar...@li...> - 2022-01-07 18:43:32
|
Happy new year! I am happy to announce the imminent release of lcms2-2.13. The first release candidate is available here: https://github.com/mm2/Little-CMS/releases/tag/lcms2.13rc1 <http://www.littlecms.com/lcms2-2.10rc1.tar.gz> Changes - Added support for premultiplied alpha - tifficc can now handle alpha channels, both unassociated and premultiplied - Better documentation - CGATS parser can now deal with very long strings - Added Projects for Visual Studio 2020 - Travis CI discontinued, GitHub actions used instead - Added a very preliminary meson build script (thanks to xclaesse) - Added ARM64 target to visual studio 2019 (thanks to gaborkertesz-linaro) - Added thread safe code to get time - Added automatic linear space detection - Added cmsGetStageContextID function - configure now accepts --without-fastfloat to turn plugin off - autogen.sh has now a --distclean toggle to get rid of all autotools generated files - Checked to work on STM32 Cortex-A, Cortex-M families - Bug & typos fixing (thanks to many reporters and contributors) Feel free to test it on all your products, tentative release date for final lcms2-2.13 is end of Jan-2022 Please contact me on any issue either on info { at } littecms.com <mailto:in...@li...> or using this list. Best regards Marti Maria The LittleCMS Project http:\www.littlecms.com <http://www.littlecms.com/> |
From: LittleCMS c. s. <in...@li...> - 2022-01-07 23:33:12
|
Happy new year! I am glad to announce the imminent release of lcms2-2.13. The first release candidate is available here: https://github.com/mm2/Little-CMS/releases/tag/lcms2.13rc1 <https://github.com/mm2/Little-CMS/releases/tag/lcms2.13rc1> (Sorry, now with the right link behind the text) Changes - Added support for premultiplied alpha - tifficc can now handle alpha channels, both unassociated and premultiplied - Better documentation - CGATS parser can now deal with very long strings - Added Projects for Visual Studio 2020 - Travis CI discontinued, GitHub actions used instead - Added a very preliminary meson build script (thanks to xclaesse) - Added ARM64 target to visual studio 2019 (thanks to gaborkertesz-linaro) - Added thread safe code to get time - Added automatic linear space detection - Added cmsGetStageContextID function - configure now accepts --without-fastfloat to turn plugin off - autogen.sh has now a --distclean toggle to get rid of all autotools generated files - Checked to work on STM32 Cortex-A, Cortex-M families - Bug & typos fixing (thanks to many reporters and contributors) Feel free to test it on all your products, tentative release date for final lcms2-2.13 is end of Jan-2022 Please contact me on any issue either on info { at } littecms.com <mailto:in...@li...> or using this list. Best regards Marti Maria The LittleCMS Project http:\www.littlecms.com <http://www.littlecms.com/> |
From: Marti M. <mar...@li...> - 2022-01-29 19:38:18
|
I am glad to announce the release of lcms2-2.13. Get it here: https://sourceforge.net/projects/lcms/files/latest/download Files kindly hosted by sourceforge Changes • Added support for premultiplied alpha • tifficc can now handle alpha channels, both unassociated and premultiplied • Better documentation • CGATS parser can now deal with very long strings • Added Projects for Visual Studio 2020 • Travis CI discontinued, GitHub actions used instead • Added a very preliminary meson build script (thanks to xclaesse) • Added ARM64 target to visual studio 2019 (thanks to gaborkertesz-linaro) • Added thread safe code to get time • Added automatic linear space detection • Added cmsGetStageContextID function • Added cmsDetectRGBProfileGamma • configure now accepts --without-fastfloat to turn plugin off • autogen.sh has now a --distclean toggle to get rid of all autotools generated files • Checked to work on STM32 Cortex-A, Cortex-M families • Bug & typos fixing (thanks to many reporters and contributors) • Fixed mem leaks and out-of bounds accesses as reported by fuzzer Best regards Marti Maria The LittleCMS Project http:\www.littlecms.com |
From: Marti M. <mar...@li...> - 2022-01-22 17:38:19
|
Hi, Many thanks to all reporters. Please see here the release candidate two, with fixes for found glitches and memory leaks. https://github.com/mm2/Little-CMS/releases/tag/lcms2.13rc2 If this candidate is ok I will proceed with the official release on end of January as expected. Best regards Marti Maria The LittleCMS Project http:\www.littlecms.com <http://www.littlecms.com/> > On 7 Jan 2022, at 18:23, Marti Maria <mar...@li...> wrote: > > Happy new year! > > I am happy to announce the imminent release of lcms2-2.13. > > The first release candidate is available here: > > https://github.com/mm2/Little-CMS/releases/tag/lcms2.13rc1 > > Changes > > - Added support for premultiplied alpha > - tifficc can now handle alpha channels, both unassociated and premultiplied > - Better documentation > - CGATS parser can now deal with very long strings > - Added Projects for Visual Studio 2020 > - Travis CI discontinued, GitHub actions used instead > - Added a very preliminary meson build script (thanks to xclaesse) > - Added ARM64 target to visual studio 2019 (thanks to gaborkertesz-linaro) > - Added thread safe code to get time > - Added automatic linear space detection > - Added cmsGetStageContextID function > - configure now accepts --without-fastfloat to turn plugin off > - autogen.sh has now a --distclean toggle to get rid of all autotools generated files > - Checked to work on STM32 Cortex-A, Cortex-M families > - Bug & typos fixing (thanks to many reporters and contributors) > > > Feel free to test it on all your products, tentative release date for final lcms2-2.13 is end of Jan-2022 Please contact me on any issue either on info { at } littecms.com <mailto:in...@li...> or using this list. > > > Best regards > Marti Maria > The LittleCMS Project > http:\www.littlecms.com <http://www.littlecms.com/> |
From: Marti M. <mar...@li...> - 2022-01-30 14:23:23
|
Hi Aaron, Thanks for reporting, but unfortunately I cannot reproduce the issue. I have extracted the profile embedded in file8.jp2 and it seems a quite typical gray profile. Tried transicc and numbers goes fine. Also tried tificc with several combinations of the profile as input and as output and everything works as expected. Could you please tell me details how are you doing the transform? In special, are you using the fast_float plugin? Thanks again and best regards Marti Maria > On 30 Jan 2022, at 02:48, Aaron Boxer <bo...@gm...> wrote: > > Hi Marti, > > Thank you for this new release! I think I have found a regression, though. > > I maintain the Grok Jpeg 2000 codec, and we use lcms2 to apply ICC profiles after > decompressing from JPEG 2000. > > The attached file file8.jp2 is a monochrome image > with a grayscale ICC profile. For decompression, the codec decompresses > the single channel, applies the ICC profile, and then converts it to RGB > (by duplicating the mono channel) > > file8.jp2.tif is the decompressed result with the older version of lcms2. > file8.jp2_new.tif is the result with lcms2 2.13. You can see that the image w/ 2.13 > is saturating at the top of the range. > > If you need, I can point you to the code that applies the ICC profile. > > Let me know if I can provide any more information. > Thanks again, > Aaron > |
From: Marti M. <mar...@li...> - 2022-01-30 16:43:18
|
It is now fixed in git. This bug has been there since 2.10 https://github.com/mm2/Little-CMS/commit/fdbfb7694f9d7048d53674b79ddfc38068bfdaf7 <https://github.com/mm2/Little-CMS/commit/fdbfb7694f9d7048d53674b79ddfc38068bfdaf7> A true pity, but 2.13 is already released. You can avoid the bug on the official releases by using cmsFLAGS_NOOPTIMIZE when input grayscale is being used. I guess this is not very common as the flaw has been unnoticed by years. In 2.13 is more evident because another bug was discarding channels G and B in the gray->RGB optimized transforms, anyway that was wrong too. Regards Marti > >> On 30 Jan 2022, at 02:48, Aaron Boxer <bo...@gm...> wrote: >> >> Hi Marti, >> >> Thank you for this new release! I think I have found a regression, though. >> >> I maintain the Grok Jpeg 2000 codec, and we use lcms2 to apply ICC profiles after >> decompressing from JPEG 2000. >> >> The attached file file8.jp2 is a monochrome image >> with a grayscale ICC profile. For decompression, the codec decompresses >> the single channel, applies the ICC profile, and then converts it to RGB >> (by duplicating the mono channel) >> >> file8.jp2.tif is the decompressed result with the older version of lcms2. >> file8.jp2_new.tif is the result with lcms2 2.13. You can see that the image w/ 2.13 >> is saturating at the top of the range. >> >> If you need, I can point you to the code that applies the ICC profile. >> >> Let me know if I can provide any more information. >> Thanks again, >> Aaron >> > > > > _______________________________________________ > Lcms-user mailing list > Lcm...@li... > https://lists.sourceforge.net/lists/listinfo/lcms-user |
From: Aaron B. <bo...@gm...> - 2022-01-30 16:17:25
|
Thanks for the fix, and once again thank you for this incredible library. On Sun, Jan 30, 2022 at 11:03 AM Marti Maria <mar...@li...> wrote: > > It is now fixed in git. This bug has been there since 2.10 > > > https://github.com/mm2/Little-CMS/commit/fdbfb7694f9d7048d53674b79ddfc38068bfdaf7 > > A true pity, but 2.13 is already released. You can avoid the bug on the > official releases by using cmsFLAGS_NOOPTIMIZE when input grayscale is > being used. I guess this is not very common as the flaw has been unnoticed > by years. In 2.13 is more evident because another bug was discarding > channels G and B in the gray->RGB optimized transforms, anyway that was > wrong too. > > Regards > Marti > > > > > On 30 Jan 2022, at 02:48, Aaron Boxer <bo...@gm...> wrote: > > Hi Marti, > > Thank you for this new release! I think I have found a regression, though. > > I maintain the Grok Jpeg 2000 codec, and we use lcms2 to apply ICC > profiles after > decompressing from JPEG 2000. > > The attached file file8.jp2 is a monochrome image > with a grayscale ICC profile. For decompression, the codec decompresses > the single channel, applies the ICC profile, and then converts it to RGB > (by duplicating the mono channel) > > file8.jp2.tif is the decompressed result with the older version of lcms2. > file8.jp2_new.tif is the result with lcms2 2.13. You can see that the > image w/ 2.13 > is saturating at the top of the range. > > If you need, I can point you to the code that applies the ICC profile. > > Let me know if I can provide any more information. > Thanks again, > Aaron > > > > > _______________________________________________ > Lcms-user mailing list > Lcm...@li... > https://lists.sourceforge.net/lists/listinfo/lcms-user > > > |
From: Marti M. <mar...@li...> - 2022-10-16 02:03:14
|
I am glad to announce the imminent release of lcms2-2.14 The first release candidate is available here: https://github.com/mm2/Little-CMS/releases/tag/lcms2.14rc1 Changes • lcms2 now fully implements ICC specification 4.4 • New multi-threaded plug-in • several fixes to keep fuzzers happy • Remove check on DLL when CMS_NO_REGISTER_KEYWORD is used • Added more validation against broken profiles • Add more help to several tools ICC Version 4.4 and the multithreaded plug-in are important milestones. Fixes because fuzzers have been many, none of them harmful in terms of exploits. Feel free to test it on all your products, tentative release date for final lcms2-2.14 is end of Oct-2022 Please contact me on any issue either on info { at } littecms.com or using this list. Best regards Marti Maria The LittleCMS Project https://www.littlecms.com |
From: <mar...@li...> - 2023-02-19 14:33:20
|
Hi, Due to some issues on 2.14, I am advancing the release of 2.15 and moving the planned features to 2.16. There was a bug that caused memory corruption when unregistering all plug-ins from a context and then deleting the context. Unfortunately, colord was doing that sequence so whole gnome was affected by that. Also, the removal of the undocumented feature of reading portions of raw tags broke the profile dump program. Not only bug fixes, with this release we have now a full MESON build, with support for the plug-ins, the samples and testbeds. Many thanks to Amyspark and Lovell Fuller for bringing this. The first release candidate is available here: https://github.com/mm2/Little-CMS/releases/tag/lcms2.15rc1 Feel free to test it on all your products, tentative release date for final lcms2-2.15 is end of Feb-2023 Please contact me on any issue either on info { at } littecms.com or using this list. Best regards Marti Maria The LittleCMS Project https://www.littlecms.com |
From: Wolthera <gri...@gm...> - 2022-10-16 10:01:20
|
Excellent! On Sun, Oct 16, 2022 at 4:04 AM Marti Maria <mar...@li...> wrote: > > I am glad to announce the imminent release of lcms2-2.14 > [snip] > > ICC Version 4.4 and the multithreaded plug-in are important milestones. Fixes because fuzzers have been many, none of them harmful in terms of exploits. > > Feel free to test it on all your products, tentative release date for final lcms2-2.14 is end of Oct-2022 Please contact me on any issue either on info { at } littecms.com or using this list. > > > Best regards > Marti Maria For people wondering, the changes are described in the 'Foreword' of the ICC 4.4 spec, and they consist of some smaller fixes, improved metadata features and most usefully the cicpTag, which is for storing colorspace encoding metadata as defined by ITU H.273, which basically defines some standard color spaces used in video broadcasting, and are used for some screen-first formats like avif and heif. While we can currently just create icc profiles or transform the data (rec 2100 can be indicated by cicp but not represented in icc v4, so for Krita we need to transform) as necessary, round tripping was less than ideal, and being able to store some cicp data inside the profiles is going to be super helpful! Are there any plans for lcms to take advantage of the cicp tag to determine colorspace, or will it just treat it as yet another bit of metadata for the time being? I'm super stoked regardless of the answer. The new threading plugin looks cool too, I imagine it's going to be a lot of help for people newly integrating lcms! -- Wolthera |
From: Marti M. <mar...@li...> - 2022-10-16 11:43:31
|
Hi, > Are there any plans for lcms to take advantage of the cicp tag to > determine colorspace, or will it just treat it as yet another bit of > metadata for the time being? I'm super stoked regardless of the > answer. Yes. for 2.14 just the metadata, for 2.15 some integration of the cicp tag to detect mismatches and avoid transforms on same profile on both sides. But this will take some time. Best regards Marti |
From: L. E. S. <am...@am...> - 2022-10-16 18:27:05
|
Hey Marti, We've gotten a bug report at Krita regarding the fast float plugin: https://bugs.kde.org/show_bug.cgi?id=460512 Haven't yet had the time to symbolicate it, so sending this to keep you aware of it. Best, amyspark On 15/10/2022 15:38, Marti Maria wrote: > I am glad to announce the imminent release of lcms2-2.14 > > The first release candidate is available here: > > https://github.com/mm2/Little-CMS/releases/tag/lcms2.14rc1 > > Changes > > • lcms2 now fully implements ICC specification 4.4 > • New multi-threaded plug-in > • several fixes to keep fuzzers happy > • Remove check on DLL when CMS_NO_REGISTER_KEYWORD is used > • Added more validation against broken profiles > • Add more help to several tools > > ICC Version 4.4 and the multithreaded plug-in are important milestones. Fixes because fuzzers have been many, none of them harmful in terms of exploits. > > Feel free to test it on all your products, tentative release date for final lcms2-2.14 is end of Oct-2022 Please contact me on any issue either on info { at } littecms.com or using this list. > > > Best regards > Marti Maria > The LittleCMS Project > https://www.littlecms.com > > > > > _______________________________________________ > Lcms-user mailing list > Lcm...@li... > https://lists.sourceforge.net/lists/listinfo/lcms-user -- amyspark 🌸 https://www.amyspark.me |
From: Marti M. <mar...@li...> - 2022-10-17 01:35:55
|
Hello, Could you try with 2.14rc1? there are some fixes on the plugin picking optimisations where it should not. Chances are that this is solved. Thanks Marti > On 16 Oct 2022, at 19:56, L. E. Segovia via Lcms-user <lcm...@li...> wrote: > > Hey Marti, > > We've gotten a bug report at Krita regarding the fast float plugin: > > https://bugs.kde.org/show_bug.cgi?id=460512 > > Haven't yet had the time to symbolicate it, so sending this to keep you aware of it. > > Best, > > amyspark > > On 15/10/2022 15:38, Marti Maria wrote: >> I am glad to announce the imminent release of lcms2-2.14 >> The first release candidate is available here: >> https://github.com/mm2/Little-CMS/releases/tag/lcms2.14rc1 >> Changes >> • lcms2 now fully implements ICC specification 4.4 >> • New multi-threaded plug-in >> • several fixes to keep fuzzers happy >> • Remove check on DLL when CMS_NO_REGISTER_KEYWORD is used >> • Added more validation against broken profiles >> • Add more help to several tools >> ICC Version 4.4 and the multithreaded plug-in are important milestones. Fixes because fuzzers have been many, none of them harmful in terms of exploits. >> Feel free to test it on all your products, tentative release date for final lcms2-2.14 is end of Oct-2022 Please contact me on any issue either on info { at } littecms.com or using this list. >> Best regards >> Marti Maria >> The LittleCMS Project >> https://www.littlecms.com >> _______________________________________________ >> Lcms-user mailing list >> Lcm...@li... >> https://lists.sourceforge.net/lists/listinfo/lcms-user > > -- > amyspark 🌸 https://www.amyspark.me > > > _______________________________________________ > Lcms-user mailing list > Lcm...@li... > https://lists.sourceforge.net/lists/listinfo/lcms-user |
From: L. E. S. <am...@am...> - 2022-10-19 00:47:16
|
Hey Marti, I've been able to reproduce the bug in both 2.13.1 and the recent release candidate, both point to this stacktrace (snipped for brevity) inside the tetrahedral RGB interpolation module: lcms2_fast_float.dll!FloatCLUTEval(_cmstransform_struct * CMMcargo, const void * Input, void * Output, unsigned int PixelsPerLine, unsigned int LineCount, const cmsStride * Stride) Line 199 (e:\krita-win\patches\Little-CMS\src\plugins\fast_float\src\fast_float_tethra.c:199) lcms2.dll!cmsDoTransform(void * Transform, const void * InputBuffer, void * OutputBuffer, unsigned int Size) Line 207 (e:\krita-win\patches\Little-CMS\src\src\cmsxform.c:207) The bug can be reproduced with 1.0 in any of the input's channels, and the source and display profiles provided in the bug report. Is there anything else I can do to help you reproduce it? Best, amyspark On 16/10/2022 16:40, Marti Maria wrote: > Hello, > > Could you try with 2.14rc1? there are some fixes on the plugin picking optimisations where it should not. Chances are that this is solved. > > Thanks > Marti > > >> On 16 Oct 2022, at 19:56, L. E. Segovia via Lcms-user <lcm...@li...> wrote: >> >> Hey Marti, >> >> We've gotten a bug report at Krita regarding the fast float plugin: >> >> https://bugs.kde.org/show_bug.cgi?id=460512 >> >> Haven't yet had the time to symbolicate it, so sending this to keep you aware of it. >> >> Best, >> >> amyspark >> >> On 15/10/2022 15:38, Marti Maria wrote: >>> I am glad to announce the imminent release of lcms2-2.14 >>> The first release candidate is available here: >>> https://github.com/mm2/Little-CMS/releases/tag/lcms2.14rc1 >>> Changes >>> • lcms2 now fully implements ICC specification 4.4 >>> • New multi-threaded plug-in >>> • several fixes to keep fuzzers happy >>> • Remove check on DLL when CMS_NO_REGISTER_KEYWORD is used >>> • Added more validation against broken profiles >>> • Add more help to several tools >>> ICC Version 4.4 and the multithreaded plug-in are important milestones. Fixes because fuzzers have been many, none of them harmful in terms of exploits. >>> Feel free to test it on all your products, tentative release date for final lcms2-2.14 is end of Oct-2022 Please contact me on any issue either on info { at } littecms.com or using this list. >>> Best regards >>> Marti Maria >>> The LittleCMS Project >>> https://www.littlecms.com >>> _______________________________________________ >>> Lcms-user mailing list >>> Lcm...@li... >>> https://lists.sourceforge.net/lists/listinfo/lcms-user >> >> -- >> amyspark 🌸 https://www.amyspark.me >> >> >> _______________________________________________ >> Lcms-user mailing list >> Lcm...@li... >> https://lists.sourceforge.net/lists/listinfo/lcms-user > -- amyspark 🌸 https://www.amyspark.me |
From: <mar...@li...> - 2022-10-19 13:04:19
|
Hi, I've tried the following code with the plug-in and your profiles. It works fine. Please let me know which differences are in the Krita call because I cannot reproduce the error. int checkKrita(void) { cmsHPROFILE hInput, hOutput; cmsHTRANSFORM xform; cmsPlugin(cmsFastFloatExtensions()); hInput = cmsOpenProfileFromFile("profile.icc", "r"); hOutput = cmsOpenProfileFromFile("Cintiq 13 #2 2022-07-29 D6500 2.2 S XYZLUT+MTX sRGB-HQ.icm", "r"); xform = cmsCreateTransform(hInput, TYPE_RGB_FLT, hOutput, TYPE_RGB_FLT, INTENT_PERCEPTUAL, 0); float ones[3] = { 1.0f, 1.0f, 1.0f }; float result[3] = { 0 }; cmsDoTransform(xform, ones, result, 1); cmsCloseProfile(hInput); cmsCloseProfile(hOutput); cmsDeleteTransform(xform); return 1; } BTW, are you linking the plug-in as a DLL? Regards Marti Maria The LittleCMS Project https://www.littlecms.com -----Original Message----- From: L. E. Segovia <am...@am...> Sent: Wednesday, October 19, 2022 2:38 AM To: Marti Maria <mar...@li...> Cc: lcm...@li... Subject: Re: [Lcms-user] [Release candidate] Little CMS 2.14 is ready to be released Hey Marti, I've been able to reproduce the bug in both 2.13.1 and the recent release candidate, both point to this stacktrace (snipped for brevity) inside the tetrahedral RGB interpolation module: lcms2_fast_float.dll!FloatCLUTEval(_cmstransform_struct * CMMcargo, const void * Input, void * Output, unsigned int PixelsPerLine, unsigned int LineCount, const cmsStride * Stride) Line 199 (e:\krita-win\patches\Little-CMS\src\plugins\fast_float\src\fast_float_tethra.c:199) lcms2.dll!cmsDoTransform(void * Transform, const void * InputBuffer, void * OutputBuffer, unsigned int Size) Line 207 (e:\krita-win\patches\Little-CMS\src\src\cmsxform.c:207) The bug can be reproduced with 1.0 in any of the input's channels, and the source and display profiles provided in the bug report. Is there anything else I can do to help you reproduce it? Best, amyspark On 16/10/2022 16:40, Marti Maria wrote: > Hello, > > Could you try with 2.14rc1? there are some fixes on the plugin picking optimisations where it should not. Chances are that this is solved. > > Thanks > Marti > > >> On 16 Oct 2022, at 19:56, L. E. Segovia via Lcms-user <lcm...@li...> wrote: >> >> Hey Marti, >> >> We've gotten a bug report at Krita regarding the fast float plugin: >> >> https://bugs.kde.org/show_bug.cgi?id=460512 >> >> Haven't yet had the time to symbolicate it, so sending this to keep you aware of it. >> >> Best, >> >> amyspark >> >> On 15/10/2022 15:38, Marti Maria wrote: >>> I am glad to announce the imminent release of lcms2-2.14 The first >>> release candidate is available here: >>> https://github.com/mm2/Little-CMS/releases/tag/lcms2.14rc1 >>> Changes >>> • lcms2 now fully implements ICC specification 4.4 >>> • New multi-threaded plug-in >>> • several fixes to keep fuzzers happy >>> • Remove check on DLL when CMS_NO_REGISTER_KEYWORD is used >>> • Added more validation against broken profiles >>> • Add more help to several tools >>> ICC Version 4.4 and the multithreaded plug-in are important milestones. Fixes because fuzzers have been many, none of them harmful in terms of exploits. >>> Feel free to test it on all your products, tentative release date for final lcms2-2.14 is end of Oct-2022 Please contact me on any issue either on info { at } littecms.com or using this list. >>> Best regards >>> Marti Maria >>> The LittleCMS Project >>> https://www.littlecms.com >>> _______________________________________________ >>> Lcms-user mailing list >>> Lcm...@li... >>> https://lists.sourceforge.net/lists/listinfo/lcms-user >> >> -- >> amyspark 🌸 https://www.amyspark.me >> >> >> _______________________________________________ >> Lcms-user mailing list >> Lcm...@li... >> https://lists.sourceforge.net/lists/listinfo/lcms-user > -- amyspark 🌸 https://www.amyspark.me |
From: L. E. S. <am...@am...> - 2022-10-20 01:53:09
|
Hi, The Krita code for the LCMS transform initialization is a nightmare... apart from a 10 y-o typo in the format definition (not declaring FLOAT_SH where we should), I've managed to consistently reproduce the bug. I've adjusted two lines below: > #include <lcms2.h> > #include <lcms2_fast_float.h> > > int main(void) > { > cmsHPROFILE hInput, hOutput; > cmsHTRANSFORM xform; > > cmsPlugin(cmsFastFloatExtensions()); > > hInput = cmsOpenProfileFromFile("profile.icc", "r"); > hOutput = cmsOpenProfileFromFile("Cintiq 13 #2 2022-07-29 D6500 2.2 S XYZLUT+MTX sRGB-HQ.icm", "r"); > > xform = cmsCreateTransform(hInput, TYPE_RGBA_FLT, hOutput, TYPE_RGBA_FLT, INTENT_PERCEPTUAL, cmsFLAGS_BLACKPOINTCOMPENSATION | cmsFLAGS_HIGHRESPRECALC); > > float ones[4] = {0.999999821f, 1.0f, 5.05994073e-08f, 1.0f }; > float result[4] = { 0 }; > > cmsDoTransform(xform, ones, result, 1); > > cmsCloseProfile(hInput); cmsCloseProfile(hOutput); > cmsDeleteTransform(xform); > return 1; > } We at Krita use RGBA, and the given conversion flags: cmsFLAGS_BLACKPOINTCOMPENSATION and cmsFLAGS_HIGHRESPRECALC. The pixel values were extracted straight from the exception stacktrace, and I've verified them separately. Best, amyspark On 19/10/2022 09:08, mar...@li... wrote: > > Hi, > > I've tried the following code with the plug-in and your profiles. It works fine. Please let me know which differences are in the Krita call because I cannot reproduce the error. > > int checkKrita(void) > { > cmsHPROFILE hInput, hOutput; > cmsHTRANSFORM xform; > > cmsPlugin(cmsFastFloatExtensions()); > > hInput = cmsOpenProfileFromFile("profile.icc", "r"); > hOutput = cmsOpenProfileFromFile("Cintiq 13 #2 2022-07-29 D6500 2.2 S XYZLUT+MTX sRGB-HQ.icm", "r"); > > xform = cmsCreateTransform(hInput, TYPE_RGB_FLT, hOutput, TYPE_RGB_FLT, INTENT_PERCEPTUAL, 0); > > float ones[3] = { 1.0f, 1.0f, 1.0f }; > float result[3] = { 0 }; > > cmsDoTransform(xform, ones, result, 1); > > cmsCloseProfile(hInput); cmsCloseProfile(hOutput); > cmsDeleteTransform(xform); > return 1; > } > > BTW, are you linking the plug-in as a DLL? > > Regards > > Marti Maria > The LittleCMS Project > https://www.littlecms.com > > -----Original Message----- > From: L. E. Segovia <am...@am...> > Sent: Wednesday, October 19, 2022 2:38 AM > To: Marti Maria <mar...@li...> > Cc: lcm...@li... > Subject: Re: [Lcms-user] [Release candidate] Little CMS 2.14 is ready to be released > > Hey Marti, > > I've been able to reproduce the bug in both 2.13.1 and the recent release candidate, both point to this stacktrace (snipped for brevity) inside the tetrahedral RGB interpolation module: > > lcms2_fast_float.dll!FloatCLUTEval(_cmstransform_struct * CMMcargo, const void * Input, void * Output, unsigned int PixelsPerLine, unsigned int LineCount, const cmsStride * Stride) Line 199 > (e:\krita-win\patches\Little-CMS\src\plugins\fast_float\src\fast_float_tethra.c:199) > lcms2.dll!cmsDoTransform(void * Transform, const void * InputBuffer, void * OutputBuffer, unsigned int Size) Line 207 > (e:\krita-win\patches\Little-CMS\src\src\cmsxform.c:207) > > The bug can be reproduced with 1.0 in any of the input's channels, and the source and display profiles provided in the bug report. > > Is there anything else I can do to help you reproduce it? > > Best, > > amyspark > > On 16/10/2022 16:40, Marti Maria wrote: >> Hello, >> >> Could you try with 2.14rc1? there are some fixes on the plugin picking optimisations where it should not. Chances are that this is solved. >> >> Thanks >> Marti >> >> >>> On 16 Oct 2022, at 19:56, L. E. Segovia via Lcms-user <lcm...@li...> wrote: >>> >>> Hey Marti, >>> >>> We've gotten a bug report at Krita regarding the fast float plugin: >>> >>> https://bugs.kde.org/show_bug.cgi?id=460512 >>> >>> Haven't yet had the time to symbolicate it, so sending this to keep you aware of it. >>> >>> Best, >>> >>> amyspark >>> >>> On 15/10/2022 15:38, Marti Maria wrote: >>>> I am glad to announce the imminent release of lcms2-2.14 The first >>>> release candidate is available here: >>>> https://github.com/mm2/Little-CMS/releases/tag/lcms2.14rc1 >>>> Changes >>>> • lcms2 now fully implements ICC specification 4.4 >>>> • New multi-threaded plug-in >>>> • several fixes to keep fuzzers happy >>>> • Remove check on DLL when CMS_NO_REGISTER_KEYWORD is used >>>> • Added more validation against broken profiles >>>> • Add more help to several tools >>>> ICC Version 4.4 and the multithreaded plug-in are important milestones. Fixes because fuzzers have been many, none of them harmful in terms of exploits. >>>> Feel free to test it on all your products, tentative release date for final lcms2-2.14 is end of Oct-2022 Please contact me on any issue either on info { at } littecms.com or using this list. >>>> Best regards >>>> Marti Maria >>>> The LittleCMS Project >>>> https://www.littlecms.com >>>> _______________________________________________ >>>> Lcms-user mailing list >>>> Lcm...@li... >>>> https://lists.sourceforge.net/lists/listinfo/lcms-user >>> >>> -- >>> amyspark 🌸 https://www.amyspark.me >>> >>> >>> _______________________________________________ >>> Lcms-user mailing list >>> Lcm...@li... >>> https://lists.sourceforge.net/lists/listinfo/lcms-user >> > > -- > amyspark 🌸 https://www.amyspark.me > -- amyspark 🌸 https://www.amyspark.me |
From: <mar...@li...> - 2022-10-20 19:52:03
|
Hello, Found the bug and fixed it in https://github.com/mm2/Little-CMS/commit/aa7f240da8dc27a0bb082462889cca9026bf2b27 It is an AMAZING bug, triggered by an issue of precision loss. For those that enjoy this kind of things I will briefly describe what was happening. I used a tweaked floor() for speed. floor() function is supposed to return the largest integer value that is less than or equal to a number. My tweaked function was using mantissa tricks to run as fast as possible. It worked for all but a small number of combinations. Well, you hit one of those bad combinations. A number like 47.9993 (I think, I may be wrong on recalling the exact number). Quick floor of this particular number returned 48 when it really was 47. At the end its only 0.0007 difference so may seem harmless... BUT this was used for interpolation so a subtraction was involved. if we try to compute the node with that faulty floor and then subtract values to get the rest, we end in a negative number. And you know, negative number mixes bad with unsigned, so at the end this was creating a nasty out-of-bounds condition. Funny enough, very few numbers are capable of that. You were lucky enough to discover the bug because you hit a bad number with white with those profiles and flags otherwise this could go unnoticed for years. Many thanks for reporting. You earned the award of "bug of the year" because its rarity. Best regards Marti Maria The LittleCMS Project https://www.littlecms.com -----Original Message----- From: L. E. Segovia <am...@am...> Sent: Thursday, October 20, 2022 3:46 AM To: mar...@li... Cc: lcm...@li... Subject: Re: [Lcms-user] [Release candidate] Little CMS 2.14 is ready to be released Hi, The Krita code for the LCMS transform initialization is a nightmare... apart from a 10 y-o typo in the format definition (not declaring FLOAT_SH where we should), I've managed to consistently reproduce the bug. I've adjusted two lines below: > #include <lcms2.h> > #include <lcms2_fast_float.h> > > int main(void) > { > cmsHPROFILE hInput, hOutput; > cmsHTRANSFORM xform; > > cmsPlugin(cmsFastFloatExtensions()); > > hInput = cmsOpenProfileFromFile("profile.icc", "r"); > hOutput = cmsOpenProfileFromFile("Cintiq 13 #2 2022-07-29 D6500 > 2.2 S XYZLUT+MTX sRGB-HQ.icm", "r"); > > xform = cmsCreateTransform(hInput, TYPE_RGBA_FLT, hOutput, > TYPE_RGBA_FLT, INTENT_PERCEPTUAL, cmsFLAGS_BLACKPOINTCOMPENSATION | > cmsFLAGS_HIGHRESPRECALC); > > float ones[4] = {0.999999821f, 1.0f, 5.05994073e-08f, 1.0f }; > float result[4] = { 0 }; > > cmsDoTransform(xform, ones, result, 1); > > cmsCloseProfile(hInput); cmsCloseProfile(hOutput); > cmsDeleteTransform(xform); > return 1; > } We at Krita use RGBA, and the given conversion flags: cmsFLAGS_BLACKPOINTCOMPENSATION and cmsFLAGS_HIGHRESPRECALC. The pixel values were extracted straight from the exception stacktrace, and I've verified them separately. Best, amyspark On 19/10/2022 09:08, mar...@li... wrote: > > Hi, > > I've tried the following code with the plug-in and your profiles. It works fine. Please let me know which differences are in the Krita call because I cannot reproduce the error. > > int checkKrita(void) > { > cmsHPROFILE hInput, hOutput; > cmsHTRANSFORM xform; > > cmsPlugin(cmsFastFloatExtensions()); > > hInput = cmsOpenProfileFromFile("profile.icc", "r"); > hOutput = cmsOpenProfileFromFile("Cintiq 13 #2 2022-07-29 D6500 > 2.2 S XYZLUT+MTX sRGB-HQ.icm", "r"); > > xform = cmsCreateTransform(hInput, TYPE_RGB_FLT, hOutput, > TYPE_RGB_FLT, INTENT_PERCEPTUAL, 0); > > float ones[3] = { 1.0f, 1.0f, 1.0f }; > float result[3] = { 0 }; > > cmsDoTransform(xform, ones, result, 1); > > cmsCloseProfile(hInput); cmsCloseProfile(hOutput); > cmsDeleteTransform(xform); > return 1; > } > > BTW, are you linking the plug-in as a DLL? > > Regards > > Marti Maria > The LittleCMS Project > https://www.littlecms.com > > -----Original Message----- > From: L. E. Segovia <am...@am...> > Sent: Wednesday, October 19, 2022 2:38 AM > To: Marti Maria <mar...@li...> > Cc: lcm...@li... > Subject: Re: [Lcms-user] [Release candidate] Little CMS 2.14 is ready > to be released > > Hey Marti, > > I've been able to reproduce the bug in both 2.13.1 and the recent release candidate, both point to this stacktrace (snipped for brevity) inside the tetrahedral RGB interpolation module: > > lcms2_fast_float.dll!FloatCLUTEval(_cmstransform_struct * CMMcargo, > const void * Input, void * Output, unsigned int PixelsPerLine, > unsigned int LineCount, const cmsStride * Stride) Line 199 > (e:\krita-win\patches\Little-CMS\src\plugins\fast_float\src\fast_float > _tethra.c:199) lcms2.dll!cmsDoTransform(void * Transform, const void * > InputBuffer, void * OutputBuffer, unsigned int Size) Line 207 > (e:\krita-win\patches\Little-CMS\src\src\cmsxform.c:207) > > The bug can be reproduced with 1.0 in any of the input's channels, and the source and display profiles provided in the bug report. > > Is there anything else I can do to help you reproduce it? > > Best, > > amyspark > > On 16/10/2022 16:40, Marti Maria wrote: >> Hello, >> >> Could you try with 2.14rc1? there are some fixes on the plugin picking optimisations where it should not. Chances are that this is solved. >> >> Thanks >> Marti >> >> >>> On 16 Oct 2022, at 19:56, L. E. Segovia via Lcms-user <lcm...@li...> wrote: >>> >>> Hey Marti, >>> >>> We've gotten a bug report at Krita regarding the fast float plugin: >>> >>> https://bugs.kde.org/show_bug.cgi?id=460512 >>> >>> Haven't yet had the time to symbolicate it, so sending this to keep you aware of it. >>> >>> Best, >>> >>> amyspark >>> >>> On 15/10/2022 15:38, Marti Maria wrote: >>>> I am glad to announce the imminent release of lcms2-2.14 The first >>>> release candidate is available here: >>>> https://github.com/mm2/Little-CMS/releases/tag/lcms2.14rc1 >>>> Changes >>>> • lcms2 now fully implements ICC specification 4.4 >>>> • New multi-threaded plug-in >>>> • several fixes to keep fuzzers happy >>>> • Remove check on DLL when CMS_NO_REGISTER_KEYWORD is used >>>> • Added more validation against broken profiles >>>> • Add more help to several tools >>>> ICC Version 4.4 and the multithreaded plug-in are important milestones. Fixes because fuzzers have been many, none of them harmful in terms of exploits. >>>> Feel free to test it on all your products, tentative release date for final lcms2-2.14 is end of Oct-2022 Please contact me on any issue either on info { at } littecms.com or using this list. >>>> Best regards >>>> Marti Maria >>>> The LittleCMS Project >>>> https://www.littlecms.com >>>> _______________________________________________ >>>> Lcms-user mailing list >>>> Lcm...@li... >>>> https://lists.sourceforge.net/lists/listinfo/lcms-user >>> >>> -- >>> amyspark 🌸 https://www.amyspark.me >>> >>> >>> _______________________________________________ >>> Lcms-user mailing list >>> Lcm...@li... >>> https://lists.sourceforge.net/lists/listinfo/lcms-user >> > > -- > amyspark 🌸 https://www.amyspark.me > -- amyspark 🌸 https://www.amyspark.me |
From: Noel C. <NCa...@Pr...> - 2022-10-21 04:18:10
|
Hi Marti, > Found the bug and fixed it in > https://github.com/mm2/Little-CMS/commit/aa7f240da8dc27a0bb082462889cca9026bf2b27 Are all your px, py, pz values always non-negative at the point of the above changes to fast_float_tethra.c? If so, a random thought... On x64 (with the Microsoft C++ compiler at least), just an (int) cast from a 32 bit float to 32 bit int, which compiles down to one x86 machine instruction - cvttss2si - will truncate to the next integer value in the direction of 0. No need to call a floor function at all. If those values can be negative... Never mind. 😊 -Noel Carboni ProDigital Software -----Original Message----- From: mar...@li... <mar...@li...> Sent: Thu, October 20, 2022 1:24 PM To: 'L. E. Segovia' <am...@am...> Cc: lcm...@li... Subject: Re: [Lcms-user] [Release candidate] Little CMS 2.14 is ready to be released Hello, Found the bug and fixed it in https://github.com/mm2/Little-CMS/commit/aa7f240da8dc27a0bb082462889cca9026bf2b27 It is an AMAZING bug, triggered by an issue of precision loss. For those that enjoy this kind of things I will briefly describe what was happening. I used a tweaked floor() for speed. floor() function is supposed to return the largest integer value that is less than or equal to a number. My tweaked function was using mantissa tricks to run as fast as possible. It worked for all but a small number of combinations. Well, you hit one of those bad combinations. A number like 47.9993 (I think, I may be wrong on recalling the exact number). Quick floor of this particular number returned 48 when it really was 47. At the end its only 0.0007 difference so may seem harmless... BUT this was used for interpolation so a subtraction was involved. if we try to compute the node with that faulty floor and then subtract values to get the rest, we end in a negative number. And you know, negative number mixes bad with unsigned, so at the end this was creating a nasty out-of-bounds condition. Funny enough, very few numbers are capable of that. You were lucky enough to discover the bug because you hit a bad number with white with those profiles and flags otherwise this could go unnoticed for years. Many thanks for reporting. You earned the award of "bug of the year" because its rarity. Best regards Marti Maria The LittleCMS Project https://www.littlecms.com -----Original Message----- From: L. E. Segovia <am...@am...> Sent: Thursday, October 20, 2022 3:46 AM To: mar...@li... Cc: lcm...@li... Subject: Re: [Lcms-user] [Release candidate] Little CMS 2.14 is ready to be released Hi, The Krita code for the LCMS transform initialization is a nightmare... apart from a 10 y-o typo in the format definition (not declaring FLOAT_SH where we should), I've managed to consistently reproduce the bug. I've adjusted two lines below: > #include <lcms2.h> > #include <lcms2_fast_float.h> > > int main(void) > { > cmsHPROFILE hInput, hOutput; > cmsHTRANSFORM xform; > > cmsPlugin(cmsFastFloatExtensions()); > > hInput = cmsOpenProfileFromFile("profile.icc", "r"); > hOutput = cmsOpenProfileFromFile("Cintiq 13 #2 2022-07-29 D6500 > 2.2 S XYZLUT+MTX sRGB-HQ.icm", "r"); > > xform = cmsCreateTransform(hInput, TYPE_RGBA_FLT, hOutput, > TYPE_RGBA_FLT, INTENT_PERCEPTUAL, cmsFLAGS_BLACKPOINTCOMPENSATION | > cmsFLAGS_HIGHRESPRECALC); > > float ones[4] = {0.999999821f, 1.0f, 5.05994073e-08f, 1.0f }; > float result[4] = { 0 }; > > cmsDoTransform(xform, ones, result, 1); > > cmsCloseProfile(hInput); cmsCloseProfile(hOutput); > cmsDeleteTransform(xform); > return 1; > } We at Krita use RGBA, and the given conversion flags: cmsFLAGS_BLACKPOINTCOMPENSATION and cmsFLAGS_HIGHRESPRECALC. The pixel values were extracted straight from the exception stacktrace, and I've verified them separately. Best, amyspark On 19/10/2022 09:08, mar...@li... wrote: > > Hi, > > I've tried the following code with the plug-in and your profiles. It works fine. Please let me know which differences are in the Krita call because I cannot reproduce the error. > > int checkKrita(void) > { > cmsHPROFILE hInput, hOutput; > cmsHTRANSFORM xform; > > cmsPlugin(cmsFastFloatExtensions()); > > hInput = cmsOpenProfileFromFile("profile.icc", "r"); > hOutput = cmsOpenProfileFromFile("Cintiq 13 #2 2022-07-29 D6500 > 2.2 S XYZLUT+MTX sRGB-HQ.icm", "r"); > > xform = cmsCreateTransform(hInput, TYPE_RGB_FLT, hOutput, > TYPE_RGB_FLT, INTENT_PERCEPTUAL, 0); > > float ones[3] = { 1.0f, 1.0f, 1.0f }; > float result[3] = { 0 }; > > cmsDoTransform(xform, ones, result, 1); > > cmsCloseProfile(hInput); cmsCloseProfile(hOutput); > cmsDeleteTransform(xform); > return 1; > } > > BTW, are you linking the plug-in as a DLL? > > Regards > > Marti Maria > The LittleCMS Project > https://www.littlecms.com > > -----Original Message----- > From: L. E. Segovia <am...@am...> > Sent: Wednesday, October 19, 2022 2:38 AM > To: Marti Maria <mar...@li...> > Cc: lcm...@li... > Subject: Re: [Lcms-user] [Release candidate] Little CMS 2.14 is ready > to be released > > Hey Marti, > > I've been able to reproduce the bug in both 2.13.1 and the recent release candidate, both point to this stacktrace (snipped for brevity) inside the tetrahedral RGB interpolation module: > > lcms2_fast_float.dll!FloatCLUTEval(_cmstransform_struct * CMMcargo, > const void * Input, void * Output, unsigned int PixelsPerLine, > unsigned int LineCount, const cmsStride * Stride) Line 199 > (e:\krita-win\patches\Little-CMS\src\plugins\fast_float\src\fast_float > _tethra.c:199) lcms2.dll!cmsDoTransform(void * Transform, const void * > InputBuffer, void * OutputBuffer, unsigned int Size) Line 207 > (e:\krita-win\patches\Little-CMS\src\src\cmsxform.c:207) > > The bug can be reproduced with 1.0 in any of the input's channels, and the source and display profiles provided in the bug report. > > Is there anything else I can do to help you reproduce it? > > Best, > > amyspark > > On 16/10/2022 16:40, Marti Maria wrote: >> Hello, >> >> Could you try with 2.14rc1? there are some fixes on the plugin picking optimisations where it should not. Chances are that this is solved. >> >> Thanks >> Marti >> >> >>> On 16 Oct 2022, at 19:56, L. E. Segovia via Lcms-user <lcm...@li...> wrote: >>> >>> Hey Marti, >>> >>> We've gotten a bug report at Krita regarding the fast float plugin: >>> >>> https://bugs.kde.org/show_bug.cgi?id=460512 >>> >>> Haven't yet had the time to symbolicate it, so sending this to keep you aware of it. >>> >>> Best, >>> >>> amyspark >>> >>> On 15/10/2022 15:38, Marti Maria wrote: >>>> I am glad to announce the imminent release of lcms2-2.14 The first >>>> release candidate is available here: >>>> https://github.com/mm2/Little-CMS/releases/tag/lcms2.14rc1 >>>> Changes >>>> • lcms2 now fully implements ICC specification 4.4 >>>> • New multi-threaded plug-in >>>> • several fixes to keep fuzzers happy >>>> • Remove check on DLL when CMS_NO_REGISTER_KEYWORD is used >>>> • Added more validation against broken profiles >>>> • Add more help to several tools >>>> ICC Version 4.4 and the multithreaded plug-in are important milestones. Fixes because fuzzers have been many, none of them harmful in terms of exploits. >>>> Feel free to test it on all your products, tentative release date for final lcms2-2.14 is end of Oct-2022 Please contact me on any issue either on info { at } littecms.com or using this list. >>>> Best regards >>>> Marti Maria >>>> The LittleCMS Project >>>> https://www.littlecms.com >>>> _______________________________________________ >>>> Lcms-user mailing list >>>> Lcm...@li... >>>> https://lists.sourceforge.net/lists/listinfo/lcms-user >>> >>> -- >>> amyspark 🌸 https://www.amyspark.me >>> >>> >>> _______________________________________________ >>> Lcms-user mailing list >>> Lcm...@li... >>> https://lists.sourceforge.net/lists/listinfo/lcms-user >> > > -- > amyspark 🌸 https://www.amyspark.me > -- amyspark 🌸 https://www.amyspark.me _______________________________________________ Lcms-user mailing list Lcm...@li... https://lists.sourceforge.net/lists/listinfo/lcms-user |
From: <mar...@li...> - 2022-10-21 15:12:22
|
Hi > If so, a random thought... On x64 (with the Microsoft C++ compiler at least), just an (int) cast from a 32 bit float to 32 bit int, which compiles down to one x86 machine instruction - cvttss2si - will truncate to the next integer value in the direction of 0. No need to call a floor function at all. Thanks. Nowadays I tend to write code for clarity and let the compiler do the optimizations. In this case, it is hardly compiler dependent. On ARM for example, clang 11 generates fcvtms versus fcvtzs on other compiler things may change. For most compilers floorf is an intrinsic. Since the algorithm is described using floor, I use floor instead of an int cast. In fact, the mantissa trick I was using is no longer faster that the floorf function. After all the optimizer rearranges code so it depends on how well the whole thing parallelizes. Floorf uses xxmm instructions and those parallelize very well. Regards Marti Maria The LittleCMS Project https://www.littlecms.com -----Original Message----- From: Noel Carboni <NCa...@Pr...> Sent: Friday, October 21, 2022 6:18 AM To: mar...@li... Cc: lcm...@li... Subject: RE: [Lcms-user] [Release candidate] Little CMS 2.14 is ready to be released Hi Marti, > Found the bug and fixed it in > https://github.com/mm2/Little-CMS/commit/aa7f240da8dc27a0bb082462889cc > a9026bf2b27 Are all your px, py, pz values always non-negative at the point of the above changes to fast_float_tethra.c? If so, a random thought... On x64 (with the Microsoft C++ compiler at least), just an (int) cast from a 32 bit float to 32 bit int, which compiles down to one x86 machine instruction - cvttss2si - will truncate to the next integer value in the direction of 0. No need to call a floor function at all. If those values can be negative... Never mind. 😊 -Noel Carboni ProDigital Software -----Original Message----- From: mar...@li... <mar...@li...> Sent: Thu, October 20, 2022 1:24 PM To: 'L. E. Segovia' <am...@am...> Cc: lcm...@li... Subject: Re: [Lcms-user] [Release candidate] Little CMS 2.14 is ready to be released Hello, Found the bug and fixed it in https://github.com/mm2/Little-CMS/commit/aa7f240da8dc27a0bb082462889cca9026bf2b27 It is an AMAZING bug, triggered by an issue of precision loss. For those that enjoy this kind of things I will briefly describe what was happening. I used a tweaked floor() for speed. floor() function is supposed to return the largest integer value that is less than or equal to a number. My tweaked function was using mantissa tricks to run as fast as possible. It worked for all but a small number of combinations. Well, you hit one of those bad combinations. A number like 47.9993 (I think, I may be wrong on recalling the exact number). Quick floor of this particular number returned 48 when it really was 47. At the end its only 0.0007 difference so may seem harmless... BUT this was used for interpolation so a subtraction was involved. if we try to compute the node with that faulty floor and then subtract values to get the rest, we end in a negative number. And you know, negative number mixes bad with unsigned, so at the end this was creating a nasty out-of-bounds condition. Funny enough, very few numbers are capable of that. You were lucky enough to discover the bug because you hit a bad number with white with those profiles and flags otherwise this could go unnoticed for years. Many thanks for reporting. You earned the award of "bug of the year" because its rarity. Best regards Marti Maria The LittleCMS Project https://www.littlecms.com -----Original Message----- From: L. E. Segovia <am...@am...> Sent: Thursday, October 20, 2022 3:46 AM To: mar...@li... Cc: lcm...@li... Subject: Re: [Lcms-user] [Release candidate] Little CMS 2.14 is ready to be released Hi, The Krita code for the LCMS transform initialization is a nightmare... apart from a 10 y-o typo in the format definition (not declaring FLOAT_SH where we should), I've managed to consistently reproduce the bug. I've adjusted two lines below: > #include <lcms2.h> > #include <lcms2_fast_float.h> > > int main(void) > { > cmsHPROFILE hInput, hOutput; > cmsHTRANSFORM xform; > > cmsPlugin(cmsFastFloatExtensions()); > > hInput = cmsOpenProfileFromFile("profile.icc", "r"); > hOutput = cmsOpenProfileFromFile("Cintiq 13 #2 2022-07-29 D6500 > 2.2 S XYZLUT+MTX sRGB-HQ.icm", "r"); > > xform = cmsCreateTransform(hInput, TYPE_RGBA_FLT, hOutput, > TYPE_RGBA_FLT, INTENT_PERCEPTUAL, cmsFLAGS_BLACKPOINTCOMPENSATION | > cmsFLAGS_HIGHRESPRECALC); > > float ones[4] = {0.999999821f, 1.0f, 5.05994073e-08f, 1.0f }; > float result[4] = { 0 }; > > cmsDoTransform(xform, ones, result, 1); > > cmsCloseProfile(hInput); cmsCloseProfile(hOutput); > cmsDeleteTransform(xform); > return 1; > } We at Krita use RGBA, and the given conversion flags: cmsFLAGS_BLACKPOINTCOMPENSATION and cmsFLAGS_HIGHRESPRECALC. The pixel values were extracted straight from the exception stacktrace, and I've verified them separately. Best, amyspark On 19/10/2022 09:08, mar...@li... wrote: > > Hi, > > I've tried the following code with the plug-in and your profiles. It works fine. Please let me know which differences are in the Krita call because I cannot reproduce the error. > > int checkKrita(void) > { > cmsHPROFILE hInput, hOutput; > cmsHTRANSFORM xform; > > cmsPlugin(cmsFastFloatExtensions()); > > hInput = cmsOpenProfileFromFile("profile.icc", "r"); > hOutput = cmsOpenProfileFromFile("Cintiq 13 #2 2022-07-29 D6500 > 2.2 S XYZLUT+MTX sRGB-HQ.icm", "r"); > > xform = cmsCreateTransform(hInput, TYPE_RGB_FLT, hOutput, > TYPE_RGB_FLT, INTENT_PERCEPTUAL, 0); > > float ones[3] = { 1.0f, 1.0f, 1.0f }; > float result[3] = { 0 }; > > cmsDoTransform(xform, ones, result, 1); > > cmsCloseProfile(hInput); cmsCloseProfile(hOutput); > cmsDeleteTransform(xform); > return 1; > } > > BTW, are you linking the plug-in as a DLL? > > Regards > > Marti Maria > The LittleCMS Project > https://www.littlecms.com > > -----Original Message----- > From: L. E. Segovia <am...@am...> > Sent: Wednesday, October 19, 2022 2:38 AM > To: Marti Maria <mar...@li...> > Cc: lcm...@li... > Subject: Re: [Lcms-user] [Release candidate] Little CMS 2.14 is ready > to be released > > Hey Marti, > > I've been able to reproduce the bug in both 2.13.1 and the recent release candidate, both point to this stacktrace (snipped for brevity) inside the tetrahedral RGB interpolation module: > > lcms2_fast_float.dll!FloatCLUTEval(_cmstransform_struct * CMMcargo, > const void * Input, void * Output, unsigned int PixelsPerLine, > unsigned int LineCount, const cmsStride * Stride) Line 199 > (e:\krita-win\patches\Little-CMS\src\plugins\fast_float\src\fast_float > _tethra.c:199) lcms2.dll!cmsDoTransform(void * Transform, const void * > InputBuffer, void * OutputBuffer, unsigned int Size) Line 207 > (e:\krita-win\patches\Little-CMS\src\src\cmsxform.c:207) > > The bug can be reproduced with 1.0 in any of the input's channels, and the source and display profiles provided in the bug report. > > Is there anything else I can do to help you reproduce it? > > Best, > > amyspark > > On 16/10/2022 16:40, Marti Maria wrote: >> Hello, >> >> Could you try with 2.14rc1? there are some fixes on the plugin picking optimisations where it should not. Chances are that this is solved. >> >> Thanks >> Marti >> >> >>> On 16 Oct 2022, at 19:56, L. E. Segovia via Lcms-user <lcm...@li...> wrote: >>> >>> Hey Marti, >>> >>> We've gotten a bug report at Krita regarding the fast float plugin: >>> >>> https://bugs.kde.org/show_bug.cgi?id=460512 >>> >>> Haven't yet had the time to symbolicate it, so sending this to keep you aware of it. >>> >>> Best, >>> >>> amyspark >>> >>> On 15/10/2022 15:38, Marti Maria wrote: >>>> I am glad to announce the imminent release of lcms2-2.14 The first >>>> release candidate is available here: >>>> https://github.com/mm2/Little-CMS/releases/tag/lcms2.14rc1 >>>> Changes >>>> • lcms2 now fully implements ICC specification 4.4 >>>> • New multi-threaded plug-in >>>> • several fixes to keep fuzzers happy >>>> • Remove check on DLL when CMS_NO_REGISTER_KEYWORD is used >>>> • Added more validation against broken profiles >>>> • Add more help to several tools >>>> ICC Version 4.4 and the multithreaded plug-in are important milestones. Fixes because fuzzers have been many, none of them harmful in terms of exploits. >>>> Feel free to test it on all your products, tentative release date for final lcms2-2.14 is end of Oct-2022 Please contact me on any issue either on info { at } littecms.com or using this list. >>>> Best regards >>>> Marti Maria >>>> The LittleCMS Project >>>> https://www.littlecms.com >>>> _______________________________________________ >>>> Lcms-user mailing list >>>> Lcm...@li... >>>> https://lists.sourceforge.net/lists/listinfo/lcms-user >>> >>> -- >>> amyspark 🌸 https://www.amyspark.me >>> >>> >>> _______________________________________________ >>> Lcms-user mailing list >>> Lcm...@li... >>> https://lists.sourceforge.net/lists/listinfo/lcms-user >> > > -- > amyspark 🌸 https://www.amyspark.me > -- amyspark 🌸 https://www.amyspark.me _______________________________________________ Lcms-user mailing list Lcm...@li... https://lists.sourceforge.net/lists/listinfo/lcms-user |
From: Noel C. <NCa...@Pr...> - 2022-10-31 10:14:38
|
Hi Marti and Little CMS list members, I've been exercising Little CMS on a new AMD Threadripper Pro system. This machine has the AMD Ryzen Threadripper Pro 5975X processor with 32 cores (64 logical processors in Windows with SMT enabled). My software divides up the color management processing into multiple threads depending on several factors including image size, cache sizes, etc. I thought you might like to see some representative performance numbers from Little CMS doing RGB to RGB color transforms (from image to monitor profiles)... Note that I am NOT using the Little CMS plug-ins, just the base code, compiled for Windows using Visual Studio 2022. Performance Message: Total Time = 10.617 milliseconds, ConvertColorOf() - Completed color conversion using 63 simultaneous threads. Image: 3032 x 2016 pixels x 16 bits per color. Performance Message: Total Time = 15.247 milliseconds, ConvertColorOf() - Completed color conversion using 64 simultaneous threads. Image: 3852 x 2598 pixels x 8 bits per color. Performance Message: Total Time = 18.508 milliseconds, ConvertColorOf() - Completed color conversion using 64 simultaneous threads. Image: 4246 x 3925 pixels x 16 bits per color. Performance Message: Total Time = 50.934 milliseconds, ConvertColorOf() - Completed color conversion using 64 simultaneous threads. Image: 8492 x 7850 pixels x 8 bits per color. Performance Message: Total Time = 40.886 milliseconds, ConvertColorOf() - Completed color conversion using 64 simultaneous threads. Image: 8492 x 7850 pixels x 16 bits per color. Performance Message: Total Time = 241.950 milliseconds, ConvertColorOf() - Completed color conversion using 64 simultaneous threads. Image: 8492 x 7850 pixels x 32 bits per color. Extrapolating from the next to last 66 megapixel entry above, we're seeing more than 1.6 gigapixels per second color-transformed. -Noel Carboni ProDigital Software |
From: <mar...@li...> - 2022-10-31 18:41:11
|
Hi Noel, Those are very good numbers, thanks for sharing! Marti Maria The LittleCMS Project https://www.littlecms.com -----Original Message----- From: Noel Carboni <NCa...@Pr...> Sent: Monday, October 31, 2022 11:14 AM To: mar...@li...; lcm...@li... Subject: Multi-threading Little CMS Performance on Modern High-End Hardware Hi Marti and Little CMS list members, I've been exercising Little CMS on a new AMD Threadripper Pro system. This machine has the AMD Ryzen Threadripper Pro 5975X processor with 32 cores (64 logical processors in Windows with SMT enabled). My software divides up the color management processing into multiple threads depending on several factors including image size, cache sizes, etc. I thought you might like to see some representative performance numbers from Little CMS doing RGB to RGB color transforms (from image to monitor profiles)... Note that I am NOT using the Little CMS plug-ins, just the base code, compiled for Windows using Visual Studio 2022. Performance Message: Total Time = 10.617 milliseconds, ConvertColorOf() - Completed color conversion using 63 simultaneous threads. Image: 3032 x 2016 pixels x 16 bits per color. Performance Message: Total Time = 15.247 milliseconds, ConvertColorOf() - Completed color conversion using 64 simultaneous threads. Image: 3852 x 2598 pixels x 8 bits per color. Performance Message: Total Time = 18.508 milliseconds, ConvertColorOf() - Completed color conversion using 64 simultaneous threads. Image: 4246 x 3925 pixels x 16 bits per color. Performance Message: Total Time = 50.934 milliseconds, ConvertColorOf() - Completed color conversion using 64 simultaneous threads. Image: 8492 x 7850 pixels x 8 bits per color. Performance Message: Total Time = 40.886 milliseconds, ConvertColorOf() - Completed color conversion using 64 simultaneous threads. Image: 8492 x 7850 pixels x 16 bits per color. Performance Message: Total Time = 241.950 milliseconds, ConvertColorOf() - Completed color conversion using 64 simultaneous threads. Image: 8492 x 7850 pixels x 32 bits per color. Extrapolating from the next to last 66 megapixel entry above, we're seeing more than 1.6 gigapixels per second color-transformed. -Noel Carboni ProDigital Software |