Opened 7 years ago

Closed 7 years ago

Last modified 6 years ago

#5760 closed enhancement (fixed)

gdalinfo : problem reading auxiliary GML info in some JPEG2000 images

Reported by: bugbuster Owned by: warmerdam
Priority: normal Milestone: 2.0.0
Component: GDAL_Raster Version: 1.11.0
Severity: normal Keywords: gmljp2
Cc:

Description

I have problems displaying auxiliary information from some JPEG2000 images. When reading the GML header, GDAL complains with the following message :

GDALJP2Metadata: Found GML Box:
<?xml version="1.0" encoding="UTF-8" standalone="no" ?><gml:FeatureCollection xmlns:gml="http://www.opengis.net/gml" xml
ns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/gml O:\tomcat\webapps\ops\
WEB-INF\resources\WFS-SERVER-05\xsd\gml\3.1.1\base\coverage.xsd">
ERROR 1: Parse error at EOF, not all elements have been closed,
starting with gml:FeatureCollection

When dumping the image file content ("od -c Image.jp2"), I noticed that line breaks of the embedded XML data are encoded with "\0" character (and not "\n").

However, Kakadu utilities can deal with these images (kdu_jp2info and kdu_show.exe (under windows))

Attached is a data sample to illustrate the problem.

Attachments (1)

Image.jp2 (3.3 KB) - added by bugbuster 7 years ago.

Download all attachments as: .zip

Change History (4)

Changed 7 years ago by bugbuster

Attachment: Image.jp2 added

comment:1 Changed 7 years ago by Even Rouault

Component: defaultGDAL_Raster
Keywords: gmljp2 added
Milestone: 2.0
Resolution: fixed
Status: newclosed
Type: defectenhancement

I've implemented a workaround, but I strongly believe that such GMLJP2 content is invalid. That should be mentionned to the data producer / software editor.

trunk r28044 "GMLJP2: be robust when parsing GMLJP2 content that has nul character instead of \n (#5760)"

comment:2 Changed 7 years ago by Even Rouault

trunk r28045 "Fix previous commit"

comment:3 Changed 6 years ago by Even Rouault

Milestone: 2.02.0.0

Milestone renamed

Note: See TracTickets for help on using tickets.