From 7cda6e59573d1efcb55d744906b6bc1dfdf9d0bf Mon Sep 17 00:00:00 2001 From: Kleis Auke Wolthuizen Date: Tue, 29 Dec 2020 13:01:54 +0100 Subject: [PATCH] Switch VIPS_FCLIP to VIPS_CLIP in vips_scRGB2{BW,sRGB} --- libvips/colour/scRGB2BW.c | 2 +- libvips/colour/scRGB2sRGB.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libvips/colour/scRGB2BW.c b/libvips/colour/scRGB2BW.c index d378ca06..f838e74d 100644 --- a/libvips/colour/scRGB2BW.c +++ b/libvips/colour/scRGB2BW.c @@ -113,7 +113,7 @@ vips_scRGB2BW_line_16( unsigned short * restrict q, float * restrict p, q += 1; for( j = 0; j < extra_bands; j++ ) - q[j] = VIPS_FCLIP( 0, p[j] * 256.0, USHRT_MAX ); + q[j] = VIPS_CLIP( 0, (int) (p[j] * 256.0), USHRT_MAX ); p += extra_bands; q += extra_bands; } diff --git a/libvips/colour/scRGB2sRGB.c b/libvips/colour/scRGB2sRGB.c index 636e77a1..79cfacb6 100644 --- a/libvips/colour/scRGB2sRGB.c +++ b/libvips/colour/scRGB2sRGB.c @@ -140,7 +140,7 @@ vips_scRGB2sRGB_line_16( unsigned short * restrict q, float * restrict p, q += 3; for( j = 0; j < extra_bands; j++ ) - q[j] = VIPS_FCLIP( 0, p[j] * 256.0, USHRT_MAX ); + q[j] = VIPS_CLIP( 0, (int) (p[j] * 256.0), USHRT_MAX ); p += extra_bands; q += extra_bands; }