Merge remote-tracking branch 'origin/7.28'

This commit is contained in:
John Cupitt 2012-07-16 14:41:12 +01:00
commit 34602a082a
5 changed files with 25 additions and 13 deletions

View File

@ -28,6 +28,8 @@
* - redone as a class * - redone as a class
* 1/2/12 * 1/2/12
* - complex ==, != were broken * - complex ==, != were broken
* 16/7/12
* - im1 > im2, im1 >= im2 were broken
*/ */
/* /*
@ -88,18 +90,16 @@ static int
vips_relational_build( VipsObject *object ) vips_relational_build( VipsObject *object )
{ {
VipsRelational *relational = (VipsRelational *) object; VipsRelational *relational = (VipsRelational *) object;
VipsArithmetic *arithmetic = (VipsArithmetic *) object; VipsBinary *binary = (VipsBinary *) object;
if( relational->relational == VIPS_OPERATION_RELATIONAL_MORE ) { if( relational->relational == VIPS_OPERATION_RELATIONAL_MORE ) {
relational->relational = VIPS_OPERATION_RELATIONAL_LESS; relational->relational = VIPS_OPERATION_RELATIONAL_LESS;
VIPS_SWAP( VipsImage *, VIPS_SWAP( VipsImage *, binary->left, binary->right );
arithmetic->ready[0], arithmetic->ready[1] );
} }
if( relational->relational == VIPS_OPERATION_RELATIONAL_MOREEQ ) { if( relational->relational == VIPS_OPERATION_RELATIONAL_MOREEQ ) {
relational->relational = VIPS_OPERATION_RELATIONAL_LESSEQ; relational->relational = VIPS_OPERATION_RELATIONAL_LESSEQ;
VIPS_SWAP( VipsImage *, VIPS_SWAP( VipsImage *, binary->left, binary->right );
arithmetic->ready[0], arithmetic->ready[1] );
} }
if( VIPS_OBJECT_CLASS( vips_relational_parent_class )->build( object ) ) if( VIPS_OBJECT_CLASS( vips_relational_parent_class )->build( object ) )

View File

@ -57,7 +57,7 @@ typedef VipsUnaryClass VipsSignClass;
G_DEFINE_TYPE( VipsSign, vips_sign, VIPS_TYPE_UNARY ); G_DEFINE_TYPE( VipsSign, vips_sign, VIPS_TYPE_UNARY );
#define CSIGN( TYPE ) { \ #define CSIGN( TYPE ) { \
TYPE *p = (TYPE *) in; \ TYPE *p = (TYPE *) in[0]; \
TYPE *q = (TYPE *) out; \ TYPE *q = (TYPE *) out; \
int x; \ int x; \
\ \
@ -82,7 +82,7 @@ G_DEFINE_TYPE( VipsSign, vips_sign, VIPS_TYPE_UNARY );
} }
#define SIGN( TYPE ) { \ #define SIGN( TYPE ) { \
TYPE *p = (TYPE *) in; \ TYPE *p = (TYPE *) in[0]; \
signed char *q = (signed char *) out; \ signed char *q = (signed char *) out; \
int x; \ int x; \
\ \

View File

@ -237,7 +237,7 @@ vips_foreign_save_jpeg_buffer_build( VipsObject *object )
area = vips_area_new_blob( (VipsCallbackFn) vips_free, obuf, olen ); area = vips_area_new_blob( (VipsCallbackFn) vips_free, obuf, olen );
g_object_set( file, "buf", area, NULL ); g_object_set( file, "buffer", area, NULL );
return( 0 ); return( 0 );
} }

View File

@ -206,7 +206,7 @@ vips_foreign_save_png_buffer_build( VipsObject *object )
area = vips_area_new_blob( (VipsCallbackFn) vips_free, obuf, olen ); area = vips_area_new_blob( (VipsCallbackFn) vips_free, obuf, olen );
g_object_set( object, "buf", area, NULL ); g_object_set( object, "buffer", area, NULL );
return( 0 ); return( 0 );
} }

View File

@ -565,16 +565,28 @@ vips_filename_suffix_match( const char *path, const char *suffixes[] )
char * char *
vips_getnextoption( char **in ) vips_getnextoption( char **in )
{ {
char *p = *in; char *p;
char *q = p; char *q;
p = *in;
q = p;
if( !p || !*p ) if( !p || !*p )
return( NULL ); return( NULL );
/* Find the next ',' not prefixed with a '\'. /* Find the next ',' not prefixed with a '\'. If the first character
* of p is ',', there can't be a previous escape character.
*/ */
while( (p = strchr( p, ',' )) && p[-1] == '\\' ) for(;;) {
if( !(p = strchr( p, ',' )) )
break;
if( p == q )
break;
if( p[-1] != '\\' )
break;
p += 1; p += 1;
}
if( p ) { if( p ) {
/* Another option follows this one .. set up to pick that out /* Another option follows this one .. set up to pick that out