Open rafal-c opened 5 years ago
Duplicate of https://sourceforge.net/p/matio/discussion/609376/thread/1b6bb464/. Ok to close as wontfix?
In my opinion it's not a duplicate. The referenced issue focuses on the fact that Mat_ReadVarInfo
doesn't read data_type
whereas in this issue I show that even after data_type
is populated it has incorrect value. So it seems that right now there is no way in matio to get the original data type of a variable (as stored in the file).
What is the purpose of data_type
if not to store the raw value of the Data Type field of a data element? (as the values of enum matio_types
suggest)?
I understand that for example for a MAT_T_COMPRESSED
variable the actual data type after decompressing is different so maybe in that case Mat_ReadVarInfo
could assign MAT_T_COMPRESSED
to data_type
and then Mat_ReadVar
could overwrite this field with the actual data type?
I do not know actually as I neither designed or implemented it. One purpose is, that the desired data type and the actual data type can differ. Question is, if the desired data type is respected by the data class already.
Consider a simple MAT file (attached) with a single variable with data type MATRIX (14) and array class INT8. After calling
Mat_VarReadInfo
on this variabledata_type
is equal to 0 (MAT_T_UNKNOWN
) and after reading data it is equal to 1 (MAT_T_INT8
). Why isn't it equal toMAT_T_MATRIX
which, as you can check in a hex editor, is precisely the value stored in the file?int8.mat.tar.gz