Opened 18 years ago
Closed 16 years ago
#1174 closed enhancement (fixed)
[PATCH] Enhancement request : specify Tiff Deflate compression level
Reported by: | Owned by: | Even Rouault | |
---|---|---|---|
Priority: | normal | Milestone: | 1.5.0 |
Component: | GDAL_Raster | Version: | unspecified |
Severity: | minor | Keywords: | gtiff deflate |
Cc: | warmerdam |
Description (last modified by )
Creation of Deflate-compressed TIFF datasets lack a creation-option allowing to specify the desired compression level. (so-called zlevel 0-9 in zlib / pseudo-tag TIFFTAG_ZIPQUALITY in libtiff)
Attachments (1)
Change History (8)
comment:1 by , 16 years ago
Keywords: | gtiff deflate added |
---|---|
Milestone: | → 1.5.0 |
Owner: | changed from | to
Summary: | Enhancement request : specify Tiff Deflate compression level → [PATCH] Enhancement request : specify Tiff Deflate compression level |
by , 16 years ago
Attachment: | gdal_svn_trunk_deflate_compression_level_1174.patch added |
---|
comment:2 by , 16 years ago
Cc: | added |
---|
comment:3 by , 16 years ago
Description: | modified (diff) |
---|
Even,
This patch looks great, go ahead and apply it in trunk.
comment:5 by , 16 years ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
Though the enhancement worked under FWTools 1.4.x, the option ZLEVEL appears to do nothing with subsequent versions (FWTools 2.0.x) based on GDAL 1.5 betas.
Tested with FWTools 2.0.3 Win32:
gdal_translate -of GTiff -co COMPRESS=DEFLATE -co ZLEVEL=9 source.tif dest.tif
Whatever the number used (1...9) the destination file always has exactly the same size/compression ratio.
comment:6 by , 16 years ago
Even,
In our discussion in IRC was I was mixed up about tiffcp. The argument for zip compression is predictor. In fact, I think your earlier analysis is correct and that this isn't a libtiff problem. The difference (I think) was the gutting of GTiffCreateCopy() and change to close, reopen and then use GDALDatasetCopyWholeRaster(). So the change in behavior wasn't (I think) in libtiff, but in geotiff.cpp. Setting the zipquality after the reopen would appear to be the right solution.
I've leave it in your hands.
comment:7 by , 16 years ago
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
Fix commited in r13326. I've also fixed JPEG_QUALITY that has the same behaviour.
Patch provided adding this feature. The only point I'm unsure is the name of the creation-option. I've chosen 'ZLEVEL'. I find ZIPQUALITY a bit confusing (it's a lossless compression).