From e6edcfe20dc944dd4c90f81fa514a70a89eb0823 Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Wed, 13 Jun 2018 16:23:21 +0100 Subject: [PATCH] improve accuracy of vector path --- ChangeLog | 1 + libvips/convolution/convi.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 410f6bba..47fc40e5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,7 @@ - configure test for g++ 7.2 and composite.cpp - don't Ping in magickload, too unreliable - ensure WebP can add metadata when compiled with libwebpmux [lovell] +- improve accuracy of vector path convolution [felixbuenemann] 12/2/18 started 8.6.3 - use pkg-config to find libjpeg, if we can diff --git a/libvips/convolution/convi.c b/libvips/convolution/convi.c index 18b812cf..527c15e3 100644 --- a/libvips/convolution/convi.c +++ b/libvips/convolution/convi.c @@ -909,7 +909,7 @@ vips_convi_intize( VipsConvi *convi, VipsImage *M ) * later, so 1.0 (for example) would become 128, which is outside * signed 8 bit. */ - shift = ceil( log2( mx + 1 ) ); + shift = ceil( log2( mx ) + 1 ); /* We need to sum n_points, so we have to shift right before adding a * new value to make sure we have enough range.