Opened 15 years ago

Last modified 15 years ago

#1216 closed defect (fixed)

libtiff messages can get lost (stderr)

Reported by: scott@… Owned by: warmerdam
Priority: high Milestone:
Component: default Version: unspecified
Severity: normal Keywords:


Messages generated by libtiff are not being routed to the GDAL handlers when a 
JPEG 2000 image contains a poorly formed GeoTIFF and a GeoTIFF/TIFF image has 
not been attempted (GTiffOneTimeInit is not being called).

Attachments (1)

RADAR_gcp.jp2 (25.3 KB) - added by scott@… 15 years ago.
JP2 file containing GeoTIFF for georeferencing

Download all attachments as: .zip

Change History (4)

comment:1 Changed 15 years ago by warmerdam


Do you have a sample file that demonstrates the problem?  I'd be more
comfortable with my fix if I could see a change in behavior. 

Changed 15 years ago by scott@…

Attachment: RADAR_gcp.jp2 added

JP2 file containing GeoTIFF for georeferencing

comment:2 Changed 15 years ago by warmerdam


I have made changes to ensure that OneTimeInit gets called for in
memory geotiff from jpeg2000,etc.  But though I tested with your file
I wasn't able to produce any warnings or errors.  Isolating the geotiff
contents to a separate file, everything in it looked fine. 

comment:3 Changed 15 years ago by scott@…

I should have mentioned that I found this using GDAL 1.3.1 and the associated 
libtiff and libgeotiff.  In libtiff 3.8.2 (and GDAL 1.3.2) there is code that 
will prevent the errors from occurring.  You may need to modify tif_dirread.c 
near the "wonky" comment which now returns when nstrips is calculated to be 
zero instead of attempting to allocate zero bytes.  I submitted a "bug" to 
libtiff about modifying the comment to explain a possible wonky situation.

Note: See TracTickets for help on using tickets.