fix demand hints for shrink

"vips shrink" was broken due to wonky demand hints, thanks Jan
This commit is contained in:
John Cupitt 2013-04-08 13:08:24 +01:00
parent 9cb1403b9b
commit 0c6da0c330
6 changed files with 14 additions and 7 deletions

View File

@ -1,6 +1,7 @@
12/3/13 started 7.32.2
- removed some left-over debugging code from configure.ac
- better error messages from vips.c
- fix demand hints so "vips shrink" works again, thanks Jan
6/2/13 started 7.32.1
- fix --without-lcms, thanks speckins

View File

@ -746,7 +746,7 @@ read_jpeg_header( ReadJpeg *jpeg, VipsImage *out )
interpretation,
xres, yres );
vips_demand_hint( out, VIPS_DEMAND_STYLE_FATSTRIP, NULL );
vips_demand_hint( out, VIPS_DEMAND_STYLE_THINSTRIP, NULL );
/* Interlaced jpegs need lots of memory to read, so our caller needs
* to know.

View File

@ -318,9 +318,10 @@ png2vips_header( Read *read, VipsImage *out )
VIPS_CODING_NONE, interpretation,
Xres, Yres );
/* We're always supposed to set dhint.
/* Sequential mode needs thinstrip to work with things like
* vips_shrink().
*/
vips_demand_hint( out, VIPS_DEMAND_STYLE_FATSTRIP, NULL );
vips_demand_hint( out, VIPS_DEMAND_STYLE_THINSTRIP, NULL );
/* Fetch the ICC profile. @name is useless, something like "icc" or
* "ICC Profile" etc. Ignore it.

View File

@ -84,6 +84,7 @@
/*
#define VIPS_DEBUG
#define DEBUG
*/
#ifdef HAVE_CONFIG_H

View File

@ -539,8 +539,10 @@ vips_image_preeval_cb( VipsImage *image, VipsProgress *progress, int *last )
vips_get_tile_size( image,
&tile_width, &tile_height, &nlines );
printf( _( "%s %s: %d threads, %d x %d tiles, groups of %d scanlines" ),
printf( _( "%s %s: %d x %d pixels, %d threads, %d x %d tiles, "
"%d lines in buffer" ),
g_get_prgname(), image->filename,
image->Xsize, image->Ysize,
vips_concurrency_get(),
tile_width, tile_height, nlines );
printf( "\n" );

View File

@ -36,6 +36,8 @@
* - some tuning .. tried an int coordinate path, not worthwhile
* 16/11/12
* - don't change xres/yres, see comment below
* 8/4/13
* - oops demand_hint was incorrect, thanks Jan
*/
/*
@ -331,12 +333,12 @@ vips_shrink_build( VipsObject *object )
if( vips_image_copy_fields( resample->out, resample->in ) )
return( -1 );
/* THINSTRIP will work, FATSTRIP will break seq mode. If you combine
* shrink with conv you'll need to use a line cache to maintain
/* THINSTRIP will work, anything else will break seq mode. If you
* combine shrink with conv you'll need to use a line cache to maintain
* sequentiality.
*/
vips_demand_hint( resample->out,
VIPS_DEMAND_STYLE_ANY, resample->in, NULL );
VIPS_DEMAND_STYLE_THINSTRIP, resample->in, NULL );
/* Size output. Note: we round the output width down!
*