xres/yres params in tiffsave were in cm

and should have been in pixels/mm

thanks f--f

see https://github.com/libvips/libvips/issues/1421
This commit is contained in:
John Cupitt 2019-09-04 17:02:24 +01:00
parent 574be4380e
commit 06fdc95038
2 changed files with 13 additions and 4 deletions

View File

@ -1,5 +1,6 @@
31/8/19 started 8.8.3
- revert sharpen restoring the input colourspace
- xres/yres tiffsave params were in pixels/cm [f--f]
9/7/19 started 8.8.2
- better early shutdown in readers

View File

@ -14,6 +14,8 @@
* - predictor defaults to horizontal, reducing file size, usually
* 13/6/18
* - add region_shrink
* 4/9/18 [f--f]
* - xres/yres params were in pixels/cm
*/
/*
@ -137,16 +139,22 @@ vips_foreign_save_tiff_build( VipsObject *object )
build( object ) )
return( -1 );
/* Default xres/yres to the values from the image.
/* Default xres/yres to the values from the image. This is always
* pixels/mm.
*/
if( !vips_object_argument_isset( object, "xres" ) )
tiff->xres = save->ready->Xres * 10.0;
tiff->xres = save->ready->Xres;
if( !vips_object_argument_isset( object, "yres" ) )
tiff->yres = save->ready->Yres * 10.0;
tiff->yres = save->ready->Yres;
/* We default to pixels/cm.
*/
tiff->xres *= 10.0;
tiff->yres *= 10.0;
/* resunit param overrides resunit metadata.
*/
if( !vips_object_argument_isset( object, "resunit" ) &&
if( vips_object_argument_isset( object, "resunit" ) &&
vips_image_get_typeof( save->ready,
VIPS_META_RESOLUTION_UNIT ) &&
!vips_image_get_string( save->ready,