#2189 closed defect (fixed)
Writing YCbCr JPEG files no longer works
Reported by: | warmerdam | Owned by: | warmerdam |
---|---|---|---|
Priority: | high | Milestone: | 1.5.1 |
Component: | GDAL_Raster | Version: | 1.5.0 |
Severity: | normal | Keywords: | gtiff geotiff |
Cc: | ysiddiqui@… |
Description
Frank,
I have found a problem with the new FW Tools (version 2.0.4):
A process that used to run before (version 1.3.1) now encounters an error. Here is the command used:
gdal_translate -co TILED=YES -co PROFILE=GeoTIFF -co COMPRESS=JPEG -co PHOTOMETRIC=YCBCR -co TFW=YES -co JPEG_QUALITY=85 infile.tif outfile.tif
The error I see in the new version is:
0Warning 1: JPEGFixupTagsSubsampling:Unable to auto-correct subsampling values, likely corrupt JPEG compressed data in first strip/tile; auto-correcting skipped ERROR 1: Input and output dataset sizes or band counts do not match in GDALDatasetCopyWholeRaster()
If you need sample data, let me know.
Yusuf
Change History (6)
comment:1 by , 16 years ago
Status: | new → assigned |
---|
comment:2 by , 16 years ago
Cc: | added |
---|
comment:3 by , 16 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
comment:4 by , 16 years ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
It has become evident that gdaladdo still has problems, primarily because after OpenOffset() many additional calls are made to SetDirectory() which reloads the directory (hence clearing the JPEGCOLORMODE) without reapplying the color mode setting.
This is corrected by restructuring the JPEGCOLORMODE setting to be in SetDirectory() so it is always applied any time the directory is loaded. This is done in trunk (r13771) and 1.5 branch (r13772).
comment:5 by , 16 years ago
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
OK, this should be alright again.
comment:6 by , 16 years ago
It turns out I needed the JPEGCOLORMODE in OpenOffset() as well. This was revealed running pure read-only cases in the test suite. Fixed in trunk (r13772) and 1.5 branch (r13773).
I have confirmed this. The problem appears to be related to the overhaul of the GeoTIFF CreateCopy() method to use GDALDatasetCopyWholeRaster() instead of lower level TIFF entry points. This seems to break down with YCbCr compressed JPEG data which I think gets opened via the RGBA interface.
Two approaches come to mind.