Merge branch '7.40'

Conflicts:
	ChangeLog
	configure.ac
This commit is contained in:
John Cupitt 2014-08-27 14:00:54 +01:00
commit 180142b2b1
6 changed files with 47 additions and 11 deletions

View File

@ -3,11 +3,17 @@
- fix pngload with libpng >1.6.1 - fix pngload with libpng >1.6.1
- add vips_resize() - add vips_resize()
21/8/14 started 7.40.7
- fix matlab load
- fix memleak in tilecache [Lovell]
- fix memleak in VipsArray [Lovell]
12/8/14 started 7.40.6 12/8/14 started 7.40.6
- more doc fixes - more doc fixes
- fix similarity rotate+scale, thanks Topochicho - fix similarity rotate+scale, thanks Topochicho
- fix 16-bit PNG save, thanks John - fix 16-bit PNG save, thanks John
- fix dzsave date on Windows, thanks John - fix dzsave date on Windows, thanks John
- fix vipsthumbnail on many-core systems, thanks James
25/7/14 started 7.40.5 25/7/14 started 7.40.5
- fix a race in im_maxpos_avg() - fix a race in im_maxpos_avg()

View File

@ -38,7 +38,7 @@ VIPS_VERSION_STRING=$VIPS_VERSION-`date`
# binary interface changes not backwards compatible?: reset age to 0 # binary interface changes not backwards compatible?: reset age to 0
LIBRARY_CURRENT=38 LIBRARY_CURRENT=38
LIBRARY_REVISION=4 LIBRARY_REVISION=5
LIBRARY_AGE=0 LIBRARY_AGE=0
# patched into include/vips/version.h # patched into include/vips/version.h

View File

@ -29,6 +29,8 @@
* - could deadlock if downstream raised an error (thanks Todd) * - could deadlock if downstream raised an error (thanks Todd)
* 25/4/13 * 25/4/13
* - cache minimisation is optional, see "persistent" flag * - cache minimisation is optional, see "persistent" flag
* 26/8/14 Lovell
* - free the hash table in _dispose()
*/ */
/* /*
@ -156,6 +158,10 @@ vips_block_cache_dispose( GObject *gobject )
VIPS_FREEF( vips_g_mutex_free, cache->lock ); VIPS_FREEF( vips_g_mutex_free, cache->lock );
VIPS_FREEF( vips_g_cond_free, cache->new_tile ); VIPS_FREEF( vips_g_cond_free, cache->new_tile );
if( cache->tiles )
g_assert( g_hash_table_size( cache->tiles ) == 0 );
VIPS_FREEF( g_hash_table_destroy, cache->tiles );
G_OBJECT_CLASS( vips_block_cache_parent_class )->dispose( gobject ); G_OBJECT_CLASS( vips_block_cache_parent_class )->dispose( gobject );
} }
@ -941,7 +947,7 @@ vips_line_cache_build( VipsObject *object )
vips_get_tile_size( block_cache->in, vips_get_tile_size( block_cache->in,
&tile_width, &tile_height, &nlines ); &tile_width, &tile_height, &nlines );
block_cache->max_tiles = 3 * block_cache->max_tiles = 4 *
(1 + nlines / block_cache->tile_height); (1 + nlines / block_cache->tile_height);
VIPS_DEBUG_MSG( "vips_line_cache_build: nlines = %d\n", VIPS_DEBUG_MSG( "vips_line_cache_build: nlines = %d\n",

View File

@ -4,6 +4,9 @@
* - transpose on load, assemble planes into bands (thanks Mikhail) * - transpose on load, assemble planes into bands (thanks Mikhail)
* 20/12/11 * 20/12/11
* - reworked as some fns ready for new-style classes * - reworked as some fns ready for new-style classes
* 21/8/14
* - swap width/height
* - set interpretation to rgb16 etc.
*/ */
/* /*
@ -150,6 +153,28 @@ static int mat2vips_formats[][2] = {
{ MAT_C_DOUBLE, VIPS_FORMAT_DOUBLE } { MAT_C_DOUBLE, VIPS_FORMAT_DOUBLE }
}; };
/* Pick an interpretation.
*/
static VipsInterpretation
mat2vips_pick_interpretation( int bands, VipsBandFormat format )
{
if( bands == 3 &&
vips_band_format_is8bit( format ) )
return( VIPS_INTERPRETATION_sRGB );
if( bands == 3 &&
(format == VIPS_FORMAT_USHORT ||
format == VIPS_FORMAT_SHORT) )
return( VIPS_INTERPRETATION_RGB16 );
if( bands == 1 &&
(format == VIPS_FORMAT_USHORT ||
format == VIPS_FORMAT_SHORT) )
return( VIPS_INTERPRETATION_GREY16 );
if( bands > 1 )
return( VIPS_INTERPRETATION_MULTIBAND );
return( VIPS_INTERPRETATION_MULTIBAND );
}
static int static int
mat2vips_get_header( matvar_t *var, VipsImage *im ) mat2vips_get_header( matvar_t *var, VipsImage *im )
{ {
@ -165,10 +190,10 @@ mat2vips_get_header( matvar_t *var, VipsImage *im )
bands = var->dims[2]; bands = var->dims[2];
case 2: case 2:
height = var->dims[1]; width = var->dims[1];
case 1: case 1:
width = var->dims[0]; height = var->dims[0];
break; break;
default: default:
@ -177,11 +202,6 @@ mat2vips_get_header( matvar_t *var, VipsImage *im )
return( -1 ); return( -1 );
} }
if( bands > 1 )
interpretation = VIPS_INTERPRETATION_MULTIBAND;
else
interpretation = VIPS_INTERPRETATION_B_W;
for( i = 0; i < VIPS_NUMBER( mat2vips_formats ); i++ ) for( i = 0; i < VIPS_NUMBER( mat2vips_formats ); i++ )
if( mat2vips_formats[i][0] == var->class_type ) if( mat2vips_formats[i][0] == var->class_type )
break; break;
@ -191,6 +211,7 @@ mat2vips_get_header( matvar_t *var, VipsImage *im )
return( -1 ); return( -1 );
} }
format = mat2vips_formats[i][1]; format = mat2vips_formats[i][1];
interpretation = mat2vips_pick_interpretation( bands, format );
vips_image_init_fields( im, vips_image_init_fields( im,
width, height, bands, width, height, bands,

View File

@ -334,6 +334,7 @@ vips_area_free_array_object( GObject **array, VipsArea *area )
for( i = 0; i < area->n; i++ ) for( i = 0; i < area->n; i++ )
VIPS_FREEF( g_object_unref, array[i] ); VIPS_FREEF( g_object_unref, array[i] );
VIPS_FREE( array );
area->n = 0; area->n = 0;
} }

View File

@ -318,8 +318,10 @@ thumbnail_open( VipsObject *process, const char *filename )
"loading jpeg with factor %d pre-shrink", "loading jpeg with factor %d pre-shrink",
jpegshrink ); jpegshrink );
/* We can't use UNBUFERRED safely on very-many-core systems.
*/
if( !(im = vips_image_new_from_file( filename, if( !(im = vips_image_new_from_file( filename,
"access", VIPS_ACCESS_SEQUENTIAL_UNBUFFERED, "access", VIPS_ACCESS_SEQUENTIAL,
"shrink", jpegshrink, "shrink", jpegshrink,
NULL )) ) NULL )) )
return( NULL ); return( NULL );
@ -328,7 +330,7 @@ thumbnail_open( VipsObject *process, const char *filename )
/* All other formats. /* All other formats.
*/ */
if( !(im = vips_image_new_from_file( filename, if( !(im = vips_image_new_from_file( filename,
"access", VIPS_ACCESS_SEQUENTIAL_UNBUFFERED, "access", VIPS_ACCESS_SEQUENTIAL,
NULL )) ) NULL )) )
return( NULL ); return( NULL );
} }