Truncate rather than floor when casting from float to int

This commit is contained in:
Lovell Fuller 2019-01-11 18:09:20 +00:00
parent f0439fbb65
commit f815ec6801

View File

@ -195,9 +195,7 @@ G_DEFINE_TYPE( VipsCast, vips_cast, VIPS_TYPE_CONVERSION );
OTYPE * restrict q = (OTYPE *) out; \
\
for( x = 0; x < sz; x++ ) { \
TEMP v = VIPS_FLOOR( p[x] ); \
\
q[x] = CAST( v ); \
q[x] = CAST( p[x] ); \
} \
}