Ticket #3064 (closed defect: fixed)

Opened 4 years ago

Last modified 4 years ago

gdaladdo fails with JPEG YCBCR when interleaving is not specified to be pixel

Reported by: eheinz Owned by: rouault
Priority: normal Milestone: 1.6.2
Component: GDAL_Raster Version: 1.6.1
Severity: normal Keywords:
Cc:

Description

gdaladdo -ro -r average --config COMPRESS_OVERVIEW JPEG --config PHOTOMETRIC_OVERVIEW YCBCR ...

fails with the following error messages: ERROR 1: JPEGLib:Improper call to JPEG library in state 101 Warning 1: JPEGLib:Application transferred too many scanlines

This happens with gdal-1.6.1.tar.gz and tiff-4.0.0beta3.tar.gz installed as external libtiff. The image to be processed is a 71936 x 71936 tiled geotiff with JPEG compression and photometric interpretation YCbCr (3x8 bit/pixel).

Change History

Changed 4 years ago by rouault

Also confirmed with :

  • gdal-1.6.1 and internal libtiff
  • gdal-trunk and internal libtiff

The error message is the same as in #2748. The cure might be similar...

Changed 4 years ago by rouault

Reproduced with :

import gdal
ds = gdal.GetDriverByName('GTiff').Create('test.tif', 71936, 71936, 3, options = ['TILED=YES', 'SPARSE_OK=YES'] )
ds = None

then

gdaladdo -ro --config COMPRESS_OVERVIEW JPEG --config PHOTOMETRIC_OVERVIEW YCBCR test.tif 2 4 8 16 32

Changed 4 years ago by warmerdam

  • status changed from new to assigned

Changed 4 years ago by rouault

  • owner changed from warmerdam to rouault
  • status changed from assigned to new
  • milestone set to 1.6.2

Changed 4 years ago by rouault

  • status changed from new to closed
  • resolution set to fixed
  • summary changed from gdaladdo fails on large geotiff with JPEG compression to gdaladdo fails with JPEG YCBCR when interleaving is not specified to be pixel

Actually, the issue doesn't come from the image being large. It comes from the fact that YCBCR uses by default subsampling, which makes it incompatible with PLANARCONFIG=SEPARATE (INTERLEAVE=BAND in GDAL terms). When building overviews, BAND interleaving was the default, so in that case of YCBCR photometry, I changed it to default to pixel interleaving.

Fixed in trunk (r17416) and branches/1.6 (r17417).

Easy workaround : explicitly add --config INTERLEAVE_OVERVIEW BAND, as suggested in  http://gdal.org/gdaladdo.html

Note: See TracTickets for help on using tickets.