From 2cb45f698e4c8c197c5512d6c869c1f9c4eae68d Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Tue, 21 Jun 2011 14:42:39 +0100 Subject: [PATCH] fix two small bugs VipsPool was not linking to the parent class correctly, ifthenelse had tangled images. --- libvips/iofuncs/pool.c | 2 +- libvips/relational/im_ifthenelse.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libvips/iofuncs/pool.c b/libvips/iofuncs/pool.c index 19543f36..c8cb8a43 100644 --- a/libvips/iofuncs/pool.c +++ b/libvips/iofuncs/pool.c @@ -103,7 +103,7 @@ */ -G_DEFINE_TYPE( VipsPool, vips_pool, VIPS_TYPE_POOL ); +G_DEFINE_TYPE( VipsPool, vips_pool, VIPS_TYPE_OBJECT ); static void vips_pool_dispose( GObject *gobject ) diff --git a/libvips/relational/im_ifthenelse.c b/libvips/relational/im_ifthenelse.c index 8ab1fa9c..a261cc3c 100644 --- a/libvips/relational/im_ifthenelse.c +++ b/libvips/relational/im_ifthenelse.c @@ -227,7 +227,7 @@ im_ifthenelse( IMAGE *c, IMAGE *a, IMAGE *b, IMAGE *out ) t[4] = c; if( im__sizealike_vec( t + 2, t + 5, 3 ) ) return( -1 ); - c = t[5]; + c = t[7]; /* If c is not uchar, do (!=0) to make a uchar image. */ @@ -238,7 +238,7 @@ im_ifthenelse( IMAGE *c, IMAGE *a, IMAGE *b, IMAGE *out ) c = t[8]; } - if( ifthenelse( c, t[6], t[7], out ) ) + if( ifthenelse( c, t[5], t[6], out ) ) return( -1 ); return( 0 );