start work on toilet-roll thumbnails again
This commit is contained in:
parent
15ee957ea9
commit
29d33b2753
@ -783,7 +783,6 @@ vips_image_get_offset( const VipsImage *image )
|
|||||||
* @image: image to get from
|
* @image: image to get from
|
||||||
*
|
*
|
||||||
* Multi-page images can have a page height. Fetch it, and sanity check it.
|
* Multi-page images can have a page height. Fetch it, and sanity check it.
|
||||||
* convolution.
|
|
||||||
*
|
*
|
||||||
* Returns: the page height.
|
* Returns: the page height.
|
||||||
*/
|
*/
|
||||||
|
@ -188,10 +188,10 @@ vips_thumbnail_read_header( VipsThumbnail *thumbnail, VipsImage *image )
|
|||||||
thumbnail->input_height = image->Ysize;
|
thumbnail->input_height = image->Ysize;
|
||||||
thumbnail->angle = vips_autorot_get_angle( image );
|
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;
|
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 =
|
thumbnail->n_pages =
|
||||||
VIPS_CLIP( 1, n_pages, MAX_LEVELS );
|
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
|
/* 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 ) {
|
if( thumbnail->n_pages > 1 ) {
|
||||||
int target_page_height = VIPS_RINT( input_height / *vshrink );
|
int target_page_height = VIPS_RINT( input_height / *vshrink );
|
||||||
|
Loading…
x
Reference in New Issue
Block a user