Opened 19 years ago

Closed 9 years ago

#813 closed enhancement (fixed)

tiff min/max sample value tag not passed through

Reported by: bolsen@… Owned by: warmerdam
Priority: high Milestone:
Component: GDAL_Raster Version: unspecified
Severity: minor Keywords:
Cc:

Description (last modified by Jukka Rahkonen)

Have an input image from a satellite which is 11bit, stored as 16bit

The 2 following tiff tags are in the original image:

  Min Sample Value: 0
  Max Sample Value: 2047

They aren't being passed through if a piece is chopped out using gdal_translate

Change History (3)

comment:1 by warmerdam, 19 years ago

Brian,

There are lots of tags that are not passed through if they don't
have an obvious place in the GDAL data model.  These might be 
suitable to return as band min/max values but I am a little 
confused from the spec whether they are real min/max values or 
not. 

I have reclassified this as an enhancement request to return the
min/max sample value tags as band min/max values. 

comment:2 by bolsen@…, 19 years ago

I probably should also add that these values need to be taken into account for
proper resampling from 16 to 8 bit where it's really an 11 to 8 bit resample.

It seems some commercial packages (Orthovista comes to mind first) actually uses
these tags in order to display a representation of the 11 bit data.

comment:3 by Jukka Rahkonen, 9 years ago

Description: modified (diff)
Resolution: fixed
Status: newclosed

I am please to inform that this 10 years old ticket can be closed as fixed. Gdal_translate from GDAL 2.0-dev (2015-01-13) transfers the TIFFTAG_MINSAMPLEVALUE and TIFFTAG_MAXSAMPLEVALUE tags unaltered into a new tiff file. If they happen to be wrong for example because of cropping they can be written back with the gdal_edit.py utility.

Note: See TracTickets for help on using tickets.