Skip to content

Commit 32a47af

Browse files
Return correct dimensions for fixed length strings
1 parent 05e5b13 commit 32a47af

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

Framework/Nexus/src/NeXusFile.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1202,15 +1202,17 @@ Info File::getInfo() {
12021202
DimArray dims{0};
12031203
ds.getSimpleExtentDims(dims.data());
12041204

1205+
// strings need the length of the string hiding in there too
1206+
// this doesn't work for variable length strings
1207+
if (hdf5ToNXType(dt) == NXnumtype::CHAR) {
1208+
dims[rank - 1] = dataset->getStorageSize();
1209+
}
1210+
12051211
Info info;
12061212
info.type = hdf5ToNXType(dt);
12071213
info.dims.push_back(dims.front());
12081214
for (std::size_t i = 1; i < rank; i++) {
1209-
// if (dt.getClass() == H5T_STRING && dims[i] == 1) {
1210-
// continue;
1211-
// } else {
12121215
info.dims.push_back(dims[i]);
1213-
// }
12141216
}
12151217
return info;
12161218
}

0 commit comments

Comments
 (0)