expand tiff write res range

see

https://github.com/jcupitt/libvips/issues/206
This commit is contained in:
John Cupitt 2014-12-10 09:23:13 +00:00
parent aa6c883434
commit 64bdadadf2
2 changed files with 6 additions and 6 deletions

View File

@ -238,14 +238,14 @@ vips_foreign_save_tiff_class_init( VipsForeignSaveTiffClass *class )
_( "Horizontal resolution in pixels/mm" ), _( "Horizontal resolution in pixels/mm" ),
VIPS_ARGUMENT_OPTIONAL_INPUT, VIPS_ARGUMENT_OPTIONAL_INPUT,
G_STRUCT_OFFSET( VipsForeignSaveTiff, xres ), G_STRUCT_OFFSET( VipsForeignSaveTiff, xres ),
-0.0, 1000000, 0 ); 0.001, 1000000, 1 );
VIPS_ARG_DOUBLE( class, "yres", 17, VIPS_ARG_DOUBLE( class, "yres", 17,
_( "Yres" ), _( "Yres" ),
_( "Vertical resolution in pixels/mm" ), _( "Vertical resolution in pixels/mm" ),
VIPS_ARGUMENT_OPTIONAL_INPUT, VIPS_ARGUMENT_OPTIONAL_INPUT,
G_STRUCT_OFFSET( VipsForeignSaveTiff, yres ), G_STRUCT_OFFSET( VipsForeignSaveTiff, yres ),
-0.0, 1000000, 0 ); 0.001, 1000000, 1 );
VIPS_ARG_BOOL( class, "bigtiff", 18, VIPS_ARG_BOOL( class, "bigtiff", 18,
_( "Bigtiff" ), _( "Bigtiff" ),

View File

@ -263,8 +263,8 @@ typedef struct tiff_write {
int pyramid; /* Write pyramid */ int pyramid; /* Write pyramid */
int onebit; /* Write as 1-bit TIFF */ int onebit; /* Write as 1-bit TIFF */
int resunit; /* Resolution unit (inches or cm) */ int resunit; /* Resolution unit (inches or cm) */
float xres; /* Resolution in X */ double xres; /* Resolution in X */
float yres; /* Resolution in Y */ double yres; /* Resolution in Y */
char *icc_profile; /* Profile to embed */ char *icc_profile; /* Profile to embed */
int bigtiff; /* True for bigtiff write */ int bigtiff; /* True for bigtiff write */
int rgbjpeg; /* True for RGB not YCbCr */ 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_RESOLUTIONUNIT, tw->resunit );
TIFFSetField( tif, TIFFTAG_XRESOLUTION, TIFFSetField( tif, TIFFTAG_XRESOLUTION,
VIPS_CLIP( 0.01, tw->xres, 10000 ) ); VIPS_CLIP( 0.01, tw->xres, 1000000 ) );
TIFFSetField( tif, TIFFTAG_YRESOLUTION, TIFFSetField( tif, TIFFTAG_YRESOLUTION,
VIPS_CLIP( 0.01, tw->yres, 10000 ) ); VIPS_CLIP( 0.01, tw->yres, 1000000 ) );
if( embed_profile( tw, tif ) ) if( embed_profile( tw, tif ) )
return( -1 ); return( -1 );