Ticket #2347 (new defect)

Opened 3 months ago

Last modified 3 months ago

gdaladdo -r mode completely broken?

Reported by: sprice Assigned to: mloskot
Priority: normal Milestone:
Component: GDAL_Raster Version: unspecified
Severity: normal Keywords: overviews
Cc: warmerdam

Description

If I take a generic tiff file (or a GeoTIFF) and run "gdaladdo -r mode ..." on it, the generated overviews are invalid. For example (input/output attached):

$ gdaladdo -r mode N036E108_x16_GLC.tiff 2 4
0...10...20...30...40...50...60...70...80...90...100 - done.
$ tiffsplit N036E108_x16_GLC.tiff
_TIFFVSetField: xaaa.tif: Bad value 65578 for "SampleFormat" tag.
_TIFFVSetField: xaab.tif: Bad value 65537 for "SampleFormat" tag.
_TIFFVSetField: xaac.tif: Bad value 65537 for "SampleFormat" tag.

Attachments

N036E108_x16_GLC.tiff.zip (436.5 kB) - added by sprice on 05/02/08 17:29:12.
input
xaab.tif.zip (2.6 kB) - added by sprice on 05/02/08 17:29:58.
output
mode1.diff (1.5 kB) - added by sprice on 05/03/08 15:24:39.
mode implementation
mode1.2.diff (1.5 kB) - added by sprice on 05/03/08 15:35:26.
Quick bugfix

Change History

05/02/08 17:29:12 changed by sprice

  • attachment N036E108_x16_GLC.tiff.zip added.

input

05/02/08 17:29:58 changed by sprice

  • attachment xaab.tif.zip added.

output

05/02/08 17:53:48 changed by sprice

Things I should also mention:

- By "overviews are invalid" I mean they are a singe solid color with some optional static in them. - This these output files are verified by ImageMagick?, so it most likely isn't a bug in tiffsplit. - From what I can tell, this bug has been around for a while. I have a file from November, generated on a different computer, which shows the same symptoms.

05/03/08 13:15:12 changed by warmerdam

  • keywords set to overviews.
  • owner changed from warmerdam to mloskot.
  • component changed from default to GDAL_Raster.
  • cc set to warmerdam.

It is my understanding that "mode" was never implemented for overview building (despite an early intention to do so). So I think the action item for this ticket is to improve parameter validation, error reporting and the documentation.

Mateusz, could you look into this as time permits?

05/03/08 15:24:39 changed by sprice

  • attachment mode1.diff added.

mode implementation

05/03/08 15:26:43 changed by sprice

Sounds like you need a patch like this. I'm using basically the same algorithm as the large patch that I attached here: http://trac.osgeo.org/gdal/ticket/2327

05/03/08 15:29:08 changed by sprice

Also note that the patch is incomplete in two places. See comments.

05/03/08 15:35:26 changed by sprice

  • attachment mode1.2.diff added.

Quick bugfix

05/17/08 17:26:39 changed by sprice

How is my patch? Does it help?