start work on toilet-roll thumbnails again

This commit is contained in:
John Cupitt 2019-03-02 22:13:55 +00:00
parent 15ee957ea9
commit 29d33b2753
2 changed files with 3 additions and 4 deletions

View File

@ -783,7 +783,6 @@ vips_image_get_offset( const VipsImage *image )
* @image: image to get from
*
* Multi-page images can have a page height. Fetch it, and sanity check it.
* convolution.
*
* Returns: the page height.
*/

View File

@ -188,10 +188,10 @@ vips_thumbnail_read_header( VipsThumbnail *thumbnail, VipsImage *image )
thumbnail->input_height = image->Ysize;
thumbnail->angle = vips_autorot_get_angle( image );
if( vips_image_get_typeof( image, "n-pages" ) ) {
if( vips_image_get_typeof( image, VIPS_META_N_PAGES ) ) {
int n_pages;
if( !vips_image_get_int( image, "n-pages", &n_pages ) )
if( !vips_image_get_int( image, VIPS_META_N_PAGES, &n_pages ) )
thumbnail->n_pages =
VIPS_CLIP( 1, n_pages, MAX_LEVELS );
}
@ -355,7 +355,7 @@ vips_thumbnail_calculate_shrink( VipsThumbnail *thumbnail,
}
/* In toilet-roll mode, we must adjust vshrink so that we exactly hit
* page_height, or we'll have pixels straddling pixel boundaries.
* page_height or we'll have pixels straddling pixel boundaries.
*/
if( thumbnail->n_pages > 1 ) {
int target_page_height = VIPS_RINT( input_height / *vshrink );