round to nearest in log scale

we were doing round to nearest in linear mode, but not log

see https://github.com/libvips/build-win64-mxe/issues/3
This commit is contained in:
John Cupitt 2018-12-29 20:19:38 +00:00
parent 6ba4b3bfdb
commit 9d66420ad5
2 changed files with 6 additions and 1 deletions

View File

@ -1,6 +1,7 @@
21/11/18 started 8.7.3
- fix infinite loop for autofit with non-scaleable font
- mapim was not offsetting by window offset [erdmann]
- better rounding for scale [kleisauke]
21/11/18 started 8.7.2
- more info output for temp files to help diagnose problems

View File

@ -22,6 +22,8 @@
* - use linear uchar mode
* 14/7/14
* - round to nearest on uchar output
* 29/12/18 kleisauke
* - ... and round to nearest in log mode too
*/
/*
@ -111,7 +113,9 @@ vips_scale_build( VipsObject *object )
if( vips_pow_const1( scale->in, &t[2], scale->exp, NULL ) ||
vips_linear1( t[2], &t[3], 1.0, 1.0, NULL ) ||
vips_log10( t[3], &t[4], NULL ) ||
vips_linear1( t[4], &t[5], f, 0.0,
/* Add 0.5 to get round to nearest.
*/
vips_linear1( t[4], &t[5], f, 0.5,
"uchar", TRUE,
NULL ) ||
vips_image_write( t[5], conversion->out ) )