Opened 13 years ago

Closed 13 years ago

#36 closed defect (fixed)

PrintTag (geo_print.c) could produce unreadable results

Reported by: rnicz Owned by: warmerdam
Priority: normal Milestone:
Component: libgeotiff Version:
Keywords: Cc:

Description (last modified by warmerdam)

In some cases listgeo could produce unreadeble ModelPixelScaleTag values.

Format code for sprint (FMT_DOUBLE - "%-17.15g") could use all 17 characters and PrintTag (geo_print.c) procedure don't care about spaces between fields. In result you can get following listgeo output:

      ModelPixelScaleTag (1,3):
         0.5002263635690950.5002263635690950                

instead of

      ModelPixelScaleTag (1,3):
         0.500226363569095 0.500226363569095 0

Unfortunatelly bad formatting is not detected by geotifcp.

--

Best regards

RNicz

Attachments (1)

#36-test.meta (965 bytes ) - added by rnicz 13 years ago.
listgeo output to reproduce error

Download all attachments as: .zip

Change History (5)

comment:1 by warmerdam, 13 years ago

Description: modified (diff)

Could you supply a small file presenting this problem?

I have *not* encountered this with the timepoints when I thought I would in the past.

by rnicz, 13 years ago

Attachment: #36-test.meta added

listgeo output to reproduce error

comment:2 by rnicz, 13 years ago

At the moment I'm not able to attach tiff image, but I've send #36-test.meta file which could be used to initialize geotiff with geotifcp, and resulting image file could be used to reproduce error. As I think, it is enought to use ModelPixelScaleTag values I cited in my post to reproduce this error. If it fails, I would send image file tomorrow.

comment:3 by warmerdam, 13 years ago

Status: newassigned

I have confirmed the problem using the steps:

geotifcp -g #36-test.meta utm.tif out.tif
listgeo out.tif > 2.meta
geotifcp -g 2.meta utm.tif out2.tif
listgeo out2.tif > 3.meta

the 2.meta file has:

      ModelPixelScaleTag (1,3):
         0.5002263635690950.5002263635690950                

and 3.meta has:

     ModelPixelScaleTag (1,3):
         0.5002263635690950                0                

comment:4 by warmerdam, 13 years ago

Resolution: fixed
Status: assignedclosed

I have modified geo_print.c to put a space between numbers to avoid this problem (r1987).

Note: See TracTickets for help on using tickets.