Skip to content

Commit 9f8dd36

Browse files
committed
colour: use cmsFLAGS_NOOPTIMIZE to keep all precision
Resolves: #3150.
1 parent 1ce9842 commit 9f8dd36

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

libvips/colour/icc_transform.c

+3-2
Original file line numberDiff line numberDiff line change
@@ -438,8 +438,9 @@ vips_icc_build( VipsObject *object )
438438

439439
/* Use cmsFLAGS_NOCACHE to disable the 1-pixel cache and make
440440
* calling cmsDoTransform() from multiple threads safe.
441+
* Use cmsFLAGS_NOOPTIMIZE to ensure we keep all precision.
441442
*/
442-
flags = cmsFLAGS_NOCACHE;
443+
flags = cmsFLAGS_NOCACHE | cmsFLAGS_NOOPTIMIZE;
443444

444445
if( icc->black_point_compensation )
445446
flags |= cmsFLAGS_BLACKPOINTCOMPENSATION;
@@ -1228,7 +1229,7 @@ vips_icc_transform_init( VipsIccTransform *transform )
12281229
* @out: (out): output image
12291230
* @profile_filename: use this profile
12301231
*
1231-
* Transform an image from absolute to relative colorimetry using the
1232+
* Transform an image from absolute to relative colorimetric using the
12321233
* MediaWhitePoint stored in the ICC profile.
12331234
*
12341235
* See also: vips_icc_transform(), vips_icc_import().

test/test-suite/test_resample.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -237,12 +237,11 @@ def test_thumbnail_icc(self):
237237
assert im.width == 290
238238
assert im.height == 442
239239
assert im.bands == 3
240-
assert im.bands == 3
241240

242241
# the colour distance should not deviate too much
243242
# (i.e. the embedded profile should not be ignored)
244243
im_orig = pyvips.Image.new_from_file(JPEG_FILE)
245-
assert im_orig.de00(im).max() < 10
244+
assert im_orig.de00(im).max() < 11
246245

247246
def test_similarity(self):
248247
im = pyvips.Image.new_from_file(JPEG_FILE)

0 commit comments

Comments
 (0)