[Gdal-dev] XResolution / YResolution tags
Frank Warmerdam
fwarmerdam at gmail.com
Thu Jul 28 09:59:19 EDT 2005
> On Thu, Jul 28, 2005 at 12:53:25AM +0200, G?rald CLETTE wrote:
> > I've found in the TIFF specification Rev 6.0 that the X/YResolution
> > tags don't have any default value. It's also written that these tags
> > are required for Bilevel Images, Grayscale images, Palette color
> > images as well as for RGB images. I noticed that applications can
> > display the images with no care (!) with these tags but it's not
> > written that these tags can be absent.
> >
> > I'm just trying to find how to get a default value for these tags (if
> > any but I don'tthink that it's a good idea to fx one) or a way to
> > calculate it.
Gerald,
I would personally suggest a default value of:
XResolution: 1
YResolution: 1
ResolutionUnit: 1 (Unknown)
That is to say, if there is no built in resolution information then assume
that is because the sender does not know anything about what paper
resolution it ought to be displayed at! This is very common in the
remote sensing and GIS field where many images do no have an
implicit scale.
Of course, if you have to print it, then you will have to make some reasonable
decision. As Andrey suggested, printing at 72dpi might make sense but it really
depends on your circumstances.
If your concern is that GDAL is producing illegal TIFF files then please
point me directly to the part of the spec in question, and I will consider
setting default resolution information in the file.
Best regards,
--
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush | Geospatial Programmer for Rent
More information about the Gdal-dev
mailing list