Opened 16 years ago

Closed 16 years ago

#2594 closed defect (invalid)

Internal GeoTIFF overviews cannot use a different compression than the main image

Reported by: bcastello Owned by: bcastello
Priority: normal Milestone:
Component: GDAL_Raster Version: unspecified
Severity: normal Keywords:
Cc:

Description

We are using GDAL 1.5.0 - released 2007/12/18

This is the .bat command run on the file(s):

for %%i in (*.tif) DO gdaladdo -r average --config COMPRESS_OVERVIEW JPEG %%i 2 4 8 16 32 64

A sample file can be accessed here:

ftp://ftp.baronservices.com/L7_N75-W096_tc_r3_c4.TIF

Change History (8)

comment:1 by Even Rouault, 16 years ago

You didn't describe what was wrong.

If there's a problem, consider trying with gdal 1.5.2, the latest stable release, and with internal libtiff.

comment:2 by bcastello, 16 years ago

I confirmed we are using 1.5.0 released 2007/12/18

Compression not being applied to files as overviews are generated.

With this as the command line: gdaladdo -r average --config COMPRESS_OVERVIEW JPEG %%i 2 4 8

we get overviews but the output file does not have any compression applied, and no errors reported.

comment:3 by Even Rouault, 16 years ago

In fact, the behaviour you observe is expected.

http://www.gdal.org/gdaladdo.html says : "External overviews created in TIFF format may be compressed using the COMPRESS_OVERVIEW configuration option"

the important word is External. The command line you've tried creates internal overviews. Internal overviews will always use the same compression as the full resolution image. I'm not sure why, maybe FrankW knows if there's a strong reason for that ? Compatibility with some non GDAL-based readers ?

If you want compressed overviews, you can still generate external overviews. The trick with GDAL < 1.6.0 (the -ro option mentionned in the doc will only be available in GDAL 1.6.0) is to remove write permissions to the tif file before calling gdaladdo such that the .ovr file is created.

comment:4 by Even Rouault, 16 years ago

Summary: GDALADDOInternal GeoTIFF overviews cannot use a different compression than the main image

comment:5 by bcastello, 16 years ago

Then perhaps you can help me with a proper command line to convert from an uncompressed image to one that is compressed so its overviews can be generated and saved internally?

comment:6 by Even Rouault, 16 years ago

In 2 links :

And if you don't like to RTFM ;-),

  • gdal_translate old_file.tif new_file.tif -co COMPRESS=JPEG -co PHOTOMETRIC=YCBCR
  • gdaladdo -r average new_file.tif 2 4 8 16 32 64

Note that there has been quite a lot of work done in the current development version GDAL 1.6.0dev so that the size of the overviews in a compressed format can be significantly smaller than in previous GDAL releases. If you want to give it a try, you could probably test it with the latest FWTools (I'm not sure when the last FWTools version was produced and if it includes the improvements I'm mentionning)

comment:7 by bcastello, 16 years ago

Owner: changed from warmerdam to bcastello
Status: newassigned

Bien obligé !

comment:8 by Even Rouault, 16 years ago

Resolution: invalid
Status: assignedclosed

I'm closing since there's indeed no real problem.

Note: See TracTickets for help on using tickets.