From 7280540901dd5d2d265bf48f00da472f6f9339bc Mon Sep 17 00:00:00 2001 From: Calixte Denizet Date: Thu, 6 Mar 2025 19:12:26 +0100 Subject: [PATCH] [api-minor] Use an icc profile for converting CMYK to RGB --- external/iccs/CGATS001Compat-v2-micro.icc | Bin 0 -> 8464 bytes external/iccs/LICENSE | 116 +++++++++ external/iccs/README.md | 10 + external/qcms/qcms_bg.wasm | Bin 108938 -> 108940 bytes external/qcms/qcms_utils.js | 21 +- gulpfile.mjs | 18 ++ src/core/colorspace_utils.js | 15 +- src/core/evaluator.js | 1 + src/core/icc_colorspace.js | 25 +- src/core/jpg.js | 272 +--------------------- src/core/pdf_manager.js | 3 +- src/display/api.js | 4 + test/driver.js | 2 + web/app_options.js | 11 + 14 files changed, 224 insertions(+), 274 deletions(-) create mode 100755 external/iccs/CGATS001Compat-v2-micro.icc create mode 100644 external/iccs/LICENSE create mode 100644 external/iccs/README.md diff --git a/external/iccs/CGATS001Compat-v2-micro.icc b/external/iccs/CGATS001Compat-v2-micro.icc new file mode 100755 index 0000000000000000000000000000000000000000..b5a73495bfc7509837b300800d8197d94e83fab7 GIT binary patch literal 8464 zcmZwM2UHVTzX0$-Q4v8@R6r3?L=h1XPyqpz4$^zCfdC*`n-Svfy?|kRH^X8sOW-`D0@14xd&Hv5-z`7-S1O0>MECB#yei zZl3Ler+^8t09Xku0UUGlk+8`4-~>Q7A#<_Fd=#Q|cKN^4UpD}Q*|qCii*n0A6X2<- zRkw;q{Jd&hR}QtN{MY@zONO8VWWH|8ux`%Ihaph9_p7?u1dD>rF5l73%lEqZyXxNG z0f4RTFRxn#=Am^Bo?ZCg2~~ib{SFWi;0mOqrrGL0|8M)Cg($b#&kX0z2lQ>$i+^AL z-G~3P?h4ES0Asr)z)G#P+RkXRy-VQs_+4px(?X&m!{c33t+GCWj+C%rThJ$o(X_)H z3n4_-R&lxdW5bG8n=Xfb_u)NW}d^DOB$^X(!X8k_<5B+rw6n*&238zD zPg1U=Rw`>XO+D?`d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external/iccs/LICENSE new file mode 100644 index 000000000..4ee29e090 --- /dev/null +++ b/external/iccs/LICENSE @@ -0,0 +1,116 @@ +CC0 1.0 Universal + +Statement of Purpose + +The laws of most jurisdictions throughout the world automatically confer +exclusive Copyright and Related Rights (defined below) upon the creator and +subsequent owner(s) (each and all, an "owner") of an original work of +authorship and/or a database (each, a "Work"). + +Certain owners wish to permanently relinquish those rights to a Work for the +purpose of contributing to a commons of creative, cultural and scientific +works ("Commons") that the public can reliably and without fear of later +claims of infringement build upon, modify, incorporate in other works, reuse +and redistribute as freely as possible in any form whatsoever and for any +purposes, including without limitation commercial purposes. These owners may +contribute to the Commons to promote the ideal of a free culture and the +further production of creative, cultural and scientific works, or to gain +reputation or greater distribution for their Work in part through the use and +efforts of others. + +For these and/or other purposes and motivations, and without any expectation +of additional consideration or compensation, the person associating CC0 with a +Work (the "Affirmer"), to the extent that he or she is an owner of Copyright +and Related Rights in the Work, voluntarily elects to apply CC0 to the Work +and publicly distribute the Work under its terms, with knowledge of his or her +Copyright and Related Rights in the Work and the meaning and intended legal +effect of CC0 on those rights. + +1. Copyright and Related Rights. A Work made available under CC0 may be +protected by copyright and related or neighboring rights ("Copyright and +Related Rights"). Copyright and Related Rights include, but are not limited +to, the following: + + i. the right to reproduce, adapt, distribute, perform, display, communicate, + and translate a Work; + + ii. moral rights retained by the original author(s) and/or performer(s); + + iii. publicity and privacy rights pertaining to a person's image or likeness + depicted in a Work; + + iv. rights protecting against unfair competition in regards to a Work, + subject to the limitations in paragraph 4(a), below; + + v. rights protecting the extraction, dissemination, use and reuse of data in + a Work; + + vi. database rights (such as those arising under Directive 96/9/EC of the + European Parliament and of the Council of 11 March 1996 on the legal + protection of databases, and under any national implementation thereof, + including any amended or successor version of such directive); and + + vii. other similar, equivalent or corresponding rights throughout the world + based on applicable law or treaty, and any national implementations thereof. + +2. Waiver. To the greatest extent permitted by, but not in contravention of, +applicable law, Affirmer hereby overtly, fully, permanently, irrevocably and +unconditionally waives, abandons, and surrenders all of Affirmer's Copyright +and Related Rights and associated claims and causes of action, whether now +known or unknown (including existing as well as future claims and causes of +action), in the Work (i) in all territories worldwide, (ii) for the maximum +duration provided by applicable law or treaty (including future time +extensions), (iii) in any current or future medium and for any number of +copies, and (iv) for any purpose whatsoever, including without limitation +commercial, advertising or promotional purposes (the "Waiver"). Affirmer makes +the Waiver for the benefit of each member of the public at large and to the +detriment of Affirmer's heirs and successors, fully intending that such Waiver +shall not be subject to revocation, rescission, cancellation, termination, or +any other legal or equitable action to disrupt the quiet enjoyment of the Work +by the public as contemplated by Affirmer's express Statement of Purpose. + +3. Public License Fallback. Should any part of the Waiver for any reason be +judged legally invalid or ineffective under applicable law, then the Waiver +shall be preserved to the maximum extent permitted taking into account +Affirmer's express Statement of Purpose. In addition, to the extent the Waiver +is so judged Affirmer hereby grants to each affected person a royalty-free, +non transferable, non sublicensable, non exclusive, irrevocable and +unconditional license to exercise Affirmer's Copyright and Related Rights in +the Work (i) in all territories worldwide, (ii) for the maximum duration +provided by applicable law or treaty (including future time extensions), (iii) +in any current or future medium and for any number of copies, and (iv) for any +purpose whatsoever, including without limitation commercial, advertising or +promotional purposes (the "License"). The License shall be deemed effective as +of the date CC0 was applied by Affirmer to the Work. Should any part of the +License for any reason be judged legally invalid or ineffective under +applicable law, such partial invalidity or ineffectiveness shall not +invalidate the remainder of the License, and in such case Affirmer hereby +affirms that he or she will not (i) exercise any of his or her remaining +Copyright and Related Rights in the Work or (ii) assert any associated claims +and causes of action with respect to the Work, in either case contrary to +Affirmer's express Statement of Purpose. + +4. Limitations and Disclaimers. + + a. No trademark or patent rights held by Affirmer are waived, abandoned, + surrendered, licensed or otherwise affected by this document. + + b. Affirmer offers the Work as-is and makes no representations or warranties + of any kind concerning the Work, express, implied, statutory or otherwise, + including without limitation warranties of title, merchantability, fitness + for a particular purpose, non infringement, or the absence of latent or + other defects, accuracy, or the present or absence of errors, whether or not + discoverable, all to the greatest extent permissible under applicable law. + + c. Affirmer disclaims responsibility for clearing rights of other persons + that may apply to the Work or any use thereof, including without limitation + any person's Copyright and Related Rights in the Work. Further, Affirmer + disclaims responsibility for obtaining any necessary consents, permissions + or other rights required for any use of the Work. + + d. Affirmer understands and acknowledges that Creative Commons is not a + party to this document and has no duty or obligation with respect to this + CC0 or use of the Work. + +For more information, please see +http://creativecommons.org/publicdomain/zero/1.0/ diff --git a/external/iccs/README.md b/external/iccs/README.md new file mode 100644 index 000000000..0fd1266d6 --- /dev/null +++ b/external/iccs/README.md @@ -0,0 +1,10 @@ +## ICC + +The file CGATS001Compat-v2-micro.icc used to convert colors from CMYK to RGB comes from: +https://github.com/saucecontrol/Compact-ICC-Profiles + +at revision bdd84663061bc4ae95ca70decff54f581e27f702. + +## Licensing + +[CGATS001Compat-v2-micro.icc](https://github.com/saucecontrol/Compact-ICC-Profiles/blob/master/profiles/CGATS001Compat-v2-micro.icc) is under [CC0-1.0](https://creativecommons.org/publicdomain/zero/1.0/). \ No newline at end of file diff --git a/external/qcms/qcms_bg.wasm b/external/qcms/qcms_bg.wasm index f38648f4a14f8af992d66bd13ebe0c96d7afabe1..411ac2c87d37b7d349d59576579fe3b091d9e650 100644 GIT binary patch delta 47 zcmeCW%+_<6Z9_T>IJsQ4$bP-9FiyaiS|@-FDT9jHwa; DkY5i= delta 45 zcmeCV%+__8Z9_T>IJsQWV%e)thmmD`V|;^@)tB5&(EF B4-x