Opened 16 years ago

Closed 15 years ago

Last modified 15 years ago

#2526 closed defect (fixed)

NITF driver unnecessarily excludes complex float 32 as a valid format

Reported by: jdfergason Owned by: warmerdam
Priority: normal Milestone: 1.7.0
Component: GDAL_Raster Version: 1.5.0
Severity: normal Keywords:
Cc: Shawn.Gong@…

Description

The NITF driver warns about CFloat32 datatypes all though the standard fully supports them and they work fine if used. A patch to correct this is attached.

Attachments (1)

gdal-1.5.2-nitf_patch.diff (573 bytes ) - added by jdfergason 16 years ago.
patch to nitfdataset.cpp that allows GDT_CFloat32 and GDT_CFloat64

Download all attachments as: .zip

Change History (8)

comment:1 by Even Rouault, 16 years ago

Forgot to attach the patch ?

by jdfergason, 16 years ago

Attachment: gdal-1.5.2-nitf_patch.diff added

patch to nitfdataset.cpp that allows GDT_CFloat32 and GDT_CFloat64

in reply to:  1 comment:2 by jdfergason, 16 years ago

Replying to rouault:

Forgot to attach the patch ?

Sorry, my computer crashed in the middle of attaching... I hate windows :(

comment:3 by Even Rouault, 16 years ago

Are you sure that it is enough ? I've not read the NITF spec about complex values, but I fear that the byte-swapping on little-endian hosts is not properly done with just that patch.

I imagine that for CFLoat32 the order in the NITF file is (real part in float32 big-endian, complex part in float32 big-endian). But if we apply the byte-swapping on the 8 bytes with NITFSwapWords, we'll get (complex part in float32 little-endian, real part in float32 little-endian).

comment:4 by jdfergason, 16 years ago

No, I'm not sure. I have just tried it out on a few files and they work OK. I will look at a little more closely.

comment:5 by Even Rouault, 16 years ago

jdfergason, any news on that topic ?

comment:6 by Even Rouault, 15 years ago

Cc: Shawn.Gong@… added
Milestone: 1.7.0
Resolution: fixed
Status: newclosed

In trunk (r17789) : "NITF : Add support for CFloat32 read&write. Note that it is untested. Real and imaginary order was determined from spec and report from http://article.gmane.org/gmane.comp.gis.gdal.devel/19730"

Shawn, I'd appreciate feedback if you could test.

comment:7 by Even Rouault, 15 years ago

Previous commit was certainly wrong as byte swapping was concerned. Hopefully fixed by r17790

Note: See TracTickets for help on using tickets.