more vips image read fixing

thanks AFL!
This commit is contained in:
John Cupitt 2016-05-17 21:58:52 +01:00
parent af34f8f3ef
commit 6a445ea9c8
4 changed files with 13 additions and 8 deletions

View File

@ -6,6 +6,7 @@
felixbuenemann
- allow nested [] in CLI args
- restore BandFmt on unpremultiply in vipsthumbnail
- more robust vips image reading
15/4/16 started 8.3.1
- rename vips wrapper script, it was still vips-8.2, thanks Benjamin

View File

@ -196,8 +196,7 @@ const guint64 vips__image_sizeof_bandformat[] = {
guint64
vips_format_sizeof( VipsBandFormat format )
{
g_assert( format >= 0 &&
format < VIPS_FORMAT_LAST );
format = VIPS_CLIP( 0, format, VIPS_FORMAT_DPCOMPLEX );
return( vips__image_sizeof_bandformat[format] );
}

View File

@ -2786,7 +2786,8 @@ vips_image_ispartial( VipsImage *image )
int
vips_image_write_prepare( VipsImage *image )
{
g_assert( vips_object_sanity( VIPS_OBJECT( image ) ) );
if( !vips_object_sanity( VIPS_OBJECT( image ) ) )
return( -1 );
if( image->Xsize <= 0 ||
image->Ysize <= 0 ||
@ -3046,7 +3047,8 @@ vips_image_wio_input( VipsImage *image )
{
VipsImage *t1;
g_assert( vips_object_sanity( VIPS_OBJECT( image ) ) );
if( !vips_object_sanity( VIPS_OBJECT( image ) ) )
return( -1 );
#ifdef DEBUG_IO
printf( "vips_image_wio_input: wio input for %s\n",
@ -3269,8 +3271,9 @@ vips_image_inplace( VipsImage *image )
*/
int
vips_image_pio_input( VipsImage *image )
{
g_assert( vips_object_sanity( VIPS_OBJECT( image ) ) );
{
if( !vips_object_sanity( VIPS_OBJECT( image ) ) )
return( -1 );
#ifdef DEBUG_IO
printf( "vips_image_pio_input: enabling partial input for %s\n",

View File

@ -692,7 +692,7 @@ vips_threadpool_new( VipsImage *im )
VipsThreadpool *pool;
int tile_width;
int tile_height;
int n_tiles;
gint64 n_tiles;
int n_lines;
/* Allocate and init new thread block.
@ -716,7 +716,9 @@ vips_threadpool_new( VipsImage *im )
* the number of threads we create.
*/
vips_get_tile_size( im, &tile_width, &tile_height, &n_lines );
n_tiles = (1 + im->Xsize / tile_width) * (1 + im->Ysize / tile_height);
n_tiles = (1 + (gint64) im->Xsize / tile_width) *
(1 + (gint64) im->Ysize / tile_height);
n_tiles = VIPS_CLIP( 0, n_tiles, MAX_THREADS );
pool->nthr = VIPS_MIN( pool->nthr, n_tiles );
/* Attach tidy-up callback.