2004.05.15 18:00 "[Tiff] tiffset usage, ResolutionUnits", by Richard Morris

2004.05.15 18:52 "Re: [Tiff] tiffset usage, ResolutionUnits", by Frank Warmerdam

Can anyone point me to any documentation on usage of the "tiffset" utility? I am trying to convert ResolutionUnits on Tiff files from cm to inches, and am not successful so far. I see from the libtiff manual that the tag value for ResolutionUnits is 296, but I don't know how to set the value. From tiffdump output, I saw that tiff files with resolution in cm output "ResolutionUnit (296) SHORT (3) 1<3>", while tiffs with resolution in inches output "ResolutionUnit (296) SHORT (3) 1<2>".

So, it seemed to me that "tiffset -s 296 2 test.tif" should change the "ResolutionUnit flag to the value required for inches, but I keep receiving the error _TIFFVSetField: test.tif: Bad value -1077938501 for "ResolutionUnit". What are the possible values for ResolutionUnit, and how do I set them? (I am using Tiff library 3.6.1, on FreeBSD)

Or, if there are any other (shell scriptable) utilities that would do this job, I would appreciate the info.

Richard,

Unfortunately, tiffset only works for string fields, not numeric ones so I don't think there is a handy way to do what you want.

The following are the documented values for resolution units, if you find a way to use them:

#define TIFFTAG_RESOLUTIONUNIT          296     /* units of resolutions */
#define     RESUNIT_NONE                1       /* no meaningful units */
#define     RESUNIT_INCH                2       /* english */
#define     RESUNIT_CENTIMETER          3       /* metric */

Best regards,

---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam@pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent