From d68147ce8979b1da05884f98d5ba30d81ae0df2f Mon Sep 17 00:00:00 2001 From: Alexander Date: Tue, 31 Dec 2019 03:35:47 +0300 Subject: [PATCH] Fix rounding error on RGB to L conversion --- src/libImaging/Convert.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/libImaging/Convert.c b/src/libImaging/Convert.c index 60513c66d..9f5722543 100644 --- a/src/libImaging/Convert.c +++ b/src/libImaging/Convert.c @@ -44,7 +44,8 @@ #define L(rgb)\ ((INT32) (rgb)[0]*299 + (INT32) (rgb)[1]*587 + (INT32) (rgb)[2]*114) #define L24(rgb)\ - ((rgb)[0]*19595 + (rgb)[1]*38470 + (rgb)[2]*7471) + ((rgb)[0]*19595 + (rgb)[1]*38470 + (rgb)[2]*7471 + 0x8000) + #ifndef round double round(double x) {