Commit 51e03bee authored by Paal Kvamme's avatar Paal Kvamme
Browse files

Merge branch 'kvamme62/version-1' into 'master'

Allow reading version 1 ZGY files.

See merge request !54
parents 5cdd5d1d 5027ffee
Pipeline #31178 passed with stages
in 14 minutes and 3 seconds
......@@ -313,9 +313,12 @@ public:
histogram() const override
{
const InternalZGY::IHistHeaderAccess& hh = _meta->hh();
return SampleHistogram(hh.samplecount(), hh.minvalue(), hh.maxvalue(),
std::vector<std::int64_t>(hh.bins(),
hh.bins() + hh.bincount()));
if (hh.bincount() > 0 && hh.bins() != nullptr)
return SampleHistogram(hh.samplecount(), hh.minvalue(), hh.maxvalue(),
std::vector<std::int64_t>(hh.bins(),
hh.bins() + hh.bincount()));
else
return SampleHistogram();
}
std::shared_ptr<const FileStatistics> filestats_nocache() const
......
......@@ -1046,6 +1046,7 @@ ZgyInternalBulk::_deliverOneBrick(
data = data->clone();
subtiling(bricksize, data->itemsize(), data->voidData().get(), raw, true);
}
break;
}
default:
// TODO-Medium: byteswap? Or did the constvalue decode do that?
......
......@@ -1768,6 +1768,7 @@ ZgyInternalMeta::initFromOpenFile(const std::shared_ptr<FileADT>& file_in)
this->_hh = HeaderAccessFactory::createHistHeader(version);
this->_hh->read(file, _oh->histoff(), _oh->histsize());
this->_hh->calculate();
// For V2 and later, fill in the missing strings in InfoHeader
// now that the StringList is known.
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment