Opened 11 years ago

Closed 11 years ago

#3064 closed defect (fixed)

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

Reported by: eheinz Owned by: Even Rouault
Priority: normal Milestone: 1.6.2
Component: GDAL_Raster Version: 1.6.1
Severity: normal Keywords:


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 (5)

comment:1 Changed 11 years ago by Even 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...

comment:2 Changed 11 years ago by Even Rouault

Reproduced with :

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


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

comment:3 Changed 11 years ago by warmerdam

Status: newassigned

comment:4 Changed 11 years ago by Even Rouault

Milestone: 1.6.2
Owner: changed from warmerdam to Even Rouault
Status: assignednew

comment:5 Changed 11 years ago by Even Rouault

Resolution: fixed
Status: newclosed
Summary: gdaladdo fails on large geotiff with JPEG compressiongdaladdo 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

Note: See TracTickets for help on using tickets.