#5884 closed defect (fixed)
corrupted JPEG-encoded TIFFs
Reported by: | cdestigter | Owned by: | Even Rouault |
---|---|---|---|
Priority: | normal | Milestone: | 2.0.0 |
Component: | GDAL_Raster | Version: | svn-trunk |
Severity: | normal | Keywords: | gtiff |
Cc: |
Description (last modified by )
We've just upgraded to the latest trunk; many (all?) of our newly created JPEG-encoded TIFFs seem to be unreadable.
It seems to happen only when a mask band is present in the input image.
This occurs since r28208 - it works before that change and not afterwards.
$ rm -f check.* jpeg-encoded.* $ gdal_translate -of GTiff -co TILED=YES -co COMPRESS=JPEG --config GDAL_TIFF_INTERNAL_MASK YES -co JPEG_QUALITY=85 -co ALPHA=PREMULTIPLIED -co PHOTOMETRIC=YCBCR tiny.tif jpeg-encoded.tif Input file size is 106, 80 0...10...20...30...40...50...60...70...80...90...100 - done. $ gdal_translate jpeg-encoded.tif check.tif Input file size is 106, 80 0ERROR 1: JPEGLib:Huffman table 0x00 was not defined ERROR 1: TIFFReadEncodedTile() failed. ERROR 1: jpeg-encoded.tif, band 1: IReadBlock failed at X offset 0, Y offset 0 ERROR 1: GetBlockRef failed at X block offset 0, Y block offset 0
Trying -co JPEGTABLESMODE=0
(or 3) appears to avoid the problem, but I'm unfamiliar with what's going on there, so I don't know if that's a good workaround.
Attachments (1)
Change History (6)
by , 9 years ago
comment:1 by , 9 years ago
Description: | modified (diff) |
---|
comment:2 by , 9 years ago
comment:3 by , 9 years ago
Description: | modified (diff) |
---|
comment:4 by , 9 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
trunk r28755 "GTiff (trunk only): correctly reset JPEGTABLESMODE state after writing internal mask to avoid generating corrupted image (#5884); on update of JPEG-in-TIFF images, do not generate optimized Huffman tables in each strile if there are already Huffman tables in JpegTables tag"
(sample image is a waaay-downsampled tiny piece of this layer from Land Information New Zealand: https://koordinates.com/layer/3185-christchurch-post-earthquake-aerial-photos-24-feb-2011/ (licensed Creative Commons Attribution 3.0 NZ) )