mirror of
https://github.com/Unidata/netcdf-c.git
synced 2025-01-18 15:55:12 +08:00
Merge pull request #2675 from uweschulzweida/issue_#2674
Fix issue #2674
This commit is contained in:
commit
f8904d5a1d
@ -1205,12 +1205,14 @@ static int get_quantize_info(NC_VAR_INFO_T *var)
|
||||
{
|
||||
hid_t attid;
|
||||
hid_t datasetid;
|
||||
htri_t attr_exists;
|
||||
|
||||
/* Try to open an attribute of the correct name for quantize
|
||||
* info. */
|
||||
datasetid = ((NC_HDF5_VAR_INFO_T *)var->format_var_info)->hdf_datasetid;
|
||||
attid = H5Aopen_by_name(datasetid, ".", NC_QUANTIZE_BITGROOM_ATT_NAME,
|
||||
H5P_DEFAULT, H5P_DEFAULT);
|
||||
attr_exists = H5Aexists(datasetid, NC_QUANTIZE_BITGROOM_ATT_NAME);
|
||||
attid = attr_exists ? H5Aopen_by_name(datasetid, ".", NC_QUANTIZE_BITGROOM_ATT_NAME,
|
||||
H5P_DEFAULT, H5P_DEFAULT) : 0;
|
||||
|
||||
if (attid > 0)
|
||||
{
|
||||
@ -1218,16 +1220,18 @@ static int get_quantize_info(NC_VAR_INFO_T *var)
|
||||
}
|
||||
else
|
||||
{
|
||||
attid = H5Aopen_by_name(datasetid, ".", NC_QUANTIZE_GRANULARBR_ATT_NAME,
|
||||
H5P_DEFAULT, H5P_DEFAULT);
|
||||
attr_exists = H5Aexists(datasetid, NC_QUANTIZE_GRANULARBR_ATT_NAME);
|
||||
attid = attr_exists ? H5Aopen_by_name(datasetid, ".", NC_QUANTIZE_GRANULARBR_ATT_NAME,
|
||||
H5P_DEFAULT, H5P_DEFAULT) : 0;
|
||||
if (attid > 0)
|
||||
{
|
||||
var->quantize_mode = NC_QUANTIZE_GRANULARBR;
|
||||
}
|
||||
else
|
||||
{
|
||||
attid = H5Aopen_by_name(datasetid, ".", NC_QUANTIZE_BITROUND_ATT_NAME,
|
||||
H5P_DEFAULT, H5P_DEFAULT);
|
||||
attr_exists = H5Aexists(datasetid, NC_QUANTIZE_BITROUND_ATT_NAME);
|
||||
attid = attr_exists ? H5Aopen_by_name(datasetid, ".", NC_QUANTIZE_BITROUND_ATT_NAME,
|
||||
H5P_DEFAULT, H5P_DEFAULT) : 0;
|
||||
if (attid > 0)
|
||||
var->quantize_mode = NC_QUANTIZE_BITROUND;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user