diff --git a/libvips/foreign/tiffsave.c b/libvips/foreign/tiffsave.c index 14f71a92..e2991833 100644 --- a/libvips/foreign/tiffsave.c +++ b/libvips/foreign/tiffsave.c @@ -238,14 +238,14 @@ vips_foreign_save_tiff_class_init( VipsForeignSaveTiffClass *class ) _( "Horizontal resolution in pixels/mm" ), VIPS_ARGUMENT_OPTIONAL_INPUT, G_STRUCT_OFFSET( VipsForeignSaveTiff, xres ), - -0.0, 1000000, 0 ); + 0.001, 1000000, 1 ); VIPS_ARG_DOUBLE( class, "yres", 17, _( "Yres" ), _( "Vertical resolution in pixels/mm" ), VIPS_ARGUMENT_OPTIONAL_INPUT, G_STRUCT_OFFSET( VipsForeignSaveTiff, yres ), - -0.0, 1000000, 0 ); + 0.001, 1000000, 1 ); VIPS_ARG_BOOL( class, "bigtiff", 18, _( "Bigtiff" ), diff --git a/libvips/foreign/vips2tiff.c b/libvips/foreign/vips2tiff.c index d439dacf..d7e13e38 100644 --- a/libvips/foreign/vips2tiff.c +++ b/libvips/foreign/vips2tiff.c @@ -263,8 +263,8 @@ typedef struct tiff_write { int pyramid; /* Write pyramid */ int onebit; /* Write as 1-bit TIFF */ int resunit; /* Resolution unit (inches or cm) */ - float xres; /* Resolution in X */ - float yres; /* Resolution in Y */ + double xres; /* Resolution in X */ + double yres; /* Resolution in Y */ char *icc_profile; /* Profile to embed */ int bigtiff; /* True for bigtiff write */ int rgbjpeg; /* True for RGB not YCbCr */ @@ -506,9 +506,9 @@ write_tiff_header( TiffWrite *tw, TIFF *tif, int width, int height ) */ TIFFSetField( tif, TIFFTAG_RESOLUTIONUNIT, tw->resunit ); TIFFSetField( tif, TIFFTAG_XRESOLUTION, - VIPS_CLIP( 0.01, tw->xres, 10000 ) ); + VIPS_CLIP( 0.01, tw->xres, 1000000 ) ); TIFFSetField( tif, TIFFTAG_YRESOLUTION, - VIPS_CLIP( 0.01, tw->yres, 10000 ) ); + VIPS_CLIP( 0.01, tw->yres, 1000000 ) ); if( embed_profile( tw, tif ) ) return( -1 );