diff --git a/libvips/arithmetic/im_avg.c b/libvips/arithmetic/im_avg.c index dc29aff7..b0bf74aa 100644 --- a/libvips/arithmetic/im_avg.c +++ b/libvips/arithmetic/im_avg.c @@ -305,7 +305,7 @@ im__value( IMAGE *im, double *value ) IMAGE *t; if( !(t = im_open_local( im, "im__value", "p" )) || - im_extract_area( im, t, 0, 0, 1, 1 ) || + im_extract_areabands( im, t, 0, 0, 1, 1, 0, 1 ) || im_avg( t, value ) ) return( -1 ); diff --git a/libvips/arithmetic/im_minpos.c b/libvips/arithmetic/im_minpos.c index 637b5fe1..eeb2ea96 100644 --- a/libvips/arithmetic/im_minpos.c +++ b/libvips/arithmetic/im_minpos.c @@ -96,7 +96,7 @@ minpos_stop( void *seq, void *a, void *b ) /* Merge. */ - if( minpos->min > global_minpos->min ) + if( minpos->min < global_minpos->min ) *global_minpos = *minpos; im_free( seq );