Opened 13 years ago

Closed 12 years ago

Last modified 12 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 13 years ago.
patch to nitfdataset.cpp that allows GDT_CFloat32 and GDT_CFloat64

Download all attachments as: .zip

Change History (8)

comment:1 Changed 13 years ago by Even Rouault

Forgot to attach the patch ?

Changed 13 years ago by jdfergason

Attachment: gdal-1.5.2-nitf_patch.diff added

patch to nitfdataset.cpp that allows GDT_CFloat32 and GDT_CFloat64

comment:2 in reply to:  1 Changed 13 years ago by jdfergason

Replying to rouault:

Forgot to attach the patch ?

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

comment:3 Changed 13 years ago by Even Rouault

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 Changed 13 years ago by jdfergason

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 Changed 13 years ago by Even Rouault

jdfergason, any news on that topic ?

comment:6 Changed 12 years ago by Even Rouault

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 Changed 12 years ago by Even Rouault

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

Note: See TracTickets for help on using tickets.