Bug 421193

Summary: import float(4) data from hdf5-file gives wrong results.
Product: [Applications] LabPlot2 Reporter: chinoune.mehdi
Component: backendAssignee: Stefan Gerlach <stefan.gerlach>
Status: RESOLVED FIXED    
Severity: grave CC: alexander.semke, stefan.gerlach
Priority: NOR    
Version First Reported In: latest   
Target Milestone: ---   
Platform: Microsoft Windows   
OS: Microsoft Windows   
Latest Commit: Version Fixed In: 2.8
Sentry Crash Report:
Attachments: float_data

Description chinoune.mehdi 2020-05-08 15:54:38 UTC
SUMMARY
labplot2 import float(4) data as double(8) data, which leads to wrong data.
importing a float(4) array with 100 elements gives a double(8) array with 50 elements.

STEPS TO REPRODUCE
1. Import an hdf5 file with float(4) data stored in.
2. select data
3. import it inside spreadsheet
Example: 31.7244

OBSERVED RESULT
Previewed data seem good. while imported are completely wrong
9.23366E+09

EXPECTED RESULT
31.7244

SOFTWARE/OS VERSIONS
Windows: 10/18363

ADDITIONAL INFORMATION
It occurs in both 2.7.0 and nightly(2.8.0)
Comment 1 chinoune.mehdi 2020-05-09 05:25:12 UTC
Same issue on Ubunutu 20.04, version 2.7.0
Comment 2 Stefan Gerlach 2020-05-09 12:13:08 UTC
can you attach a sample hdf5 file with float(4) data? I'm not able to reproduce the problem with my data files.
Comment 3 chinoune.mehdi 2020-05-09 12:42:23 UTC
Created attachment 128282 [details]
float_data
Comment 4 Stefan Gerlach 2020-05-09 15:22:27 UTC
Git commit 95013f0b710e99feda95ef8c01d922ffd6c42846 by Stefan Gerlach.
Committed on 09/05/2020 at 15:21.
Pushed by sgerlach into branch 'master'.

[hdf5 import] Fix import of FLOAT(4) data
FIXED-IN: 2.8

M  +1    -3    src/backend/datasources/filters/HDF5Filter.cpp

https://invent.kde.org/kde/labplot/commit/95013f0b710e99feda95ef8c01d922ffd6c42846
Comment 5 Alexander Semke 2020-05-10 07:35:45 UTC
(In reply to chinoune.mehdi from comment #0)
> ADDITIONAL INFORMATION
> It occurs in both 2.7.0 and nightly(2.8.0)
Can you please try out the last nightly build and confirm it solves the problem for you?
Comment 6 chinoune.mehdi 2020-05-10 09:03:20 UTC
(In reply to Alexander Semke from comment #5)
> (In reply to chinoune.mehdi from comment #0)
> > ADDITIONAL INFORMATION
> > It occurs in both 2.7.0 and nightly(2.8.0)
> Can you please try out the last nightly build and confirm it solves the
> problem for you?

Tried this morning. Problem solved.