Opened 15 years ago

Closed 15 years ago

#2845 closed defect (fixed)

JPEG files not reading properly

Reported by: warmerdam Owned by: warmerdam
Priority: normal Milestone:
Component: GDAL_Raster Version: unspecified
Severity: normal Keywords: JPEG OSGeo4W
Cc: ersts, goggi, vjetly, pramsey

Description

Using the GDAL 1.5.4-2 package from OSGeo4W, an attempt to translate a JPEG file results in an error:

n:\data\jpeg>gdal_translate worldjpg.jpg out.tif
gdal_translate worldjpg.jpg out.tif
Input file size is 4320, 2153
0...10...20...30...40...50...60...70...80...90...100 - done.
Corrupt JPEG data: premature end of data segment

The file in question can be found at:

http://home.gdal.org/tmp/WorldJPG.jpg

This bug underlies:

http://trac.osgeo.org/qgis/ticket/1530

I believe this bug relates to special libjpeg-ipp patches made in GDAL with regard to how jpeg input buffer is accomplished. References to follow. I do not believe these changes are in any formal source releases of GDAL.

Change History (5)

comment:1 by warmerdam, 15 years ago

Status: newassigned

the JPEG IPP topic is discussed at:

http://trac.osgeo.org/gdal/wiki/JpegIPP

comment:2 by warmerdam, 15 years ago

The problem was similar to the libjpeg/IPP problem orrected by r15508, and I have applied r16363 in GDAL's copy of libjpeg. The OSGeo4W package has also been rebuilt and uploaded.

comment:3 by warmerdam, 15 years ago

Resolution: fixed
Status: assignedclosed

comment:4 by warmerdam, 15 years ago

Cc: ersts goggi vjetly pramsey added; ersts goggi removed
Resolution: fixed
Status: closedreopened

Vikalpa has reported another JPEG problem that manifests as:

gdalinfo E:\DEV\2009\Frank\jpeg\ky_2ft_naip_2006_n054e162.jpg
ERROR 1: libjpeg: Bogus Huffman table definition
gdalinfo failed - unable to open 'E:\DEV\2009\Frank\jpeg\ky_2ft_naip_2006_n054e162.jpg'.
Open GDAL Datasets:
  1 N DriverIsNULL      -1 512x512x0

It turns out it is also related to the IPP source behavior. The correction is similar to the other, but in jdmarker.c.

comment:5 by warmerdam, 15 years ago

Resolution: fixed
Status: reopenedclosed

The jdmarker.c fixes are in gdal trunk's copy of libjpeg (r16601).

OSGeo4W jpeg package updated, and uploaded (libjpeg-6b-5).

Updated http://trac.osgeo.org/gdal/wiki/JpegIPP.

Note: See TracTickets for help on using tickets.