polyvertex / fitdecode

A FIT file parsing and decoding library written in Python3
MIT License
155 stars 33 forks source link

Fit parsing error #13

Closed Kypaz closed 3 years ago

Kypaz commented 3 years ago

Hello, I have a fit reading problem (the file is attached)

FIT parsing error @ 235: invalid field size 1 for type uint32 (expected a multiple of 4)

I have the problem with 0.7 or 0.6

The supposed FIT SDK version of the file is 20.63.0 (told by supplier of fit file)

I imported succesfully this fit file in Garmin Connect so this is not a corrupted file

Can you help me?

Best regards,

Alexandre [Bouquet] fit_error.fit.zip

Kypaz commented 3 years ago

Any idea?

Best, Alexandre

polyvertex commented 3 years ago

Do you happen to know the device model that generated the file initially? Note that sometimes it can be found in the fit file itself.

Kypaz commented 3 years ago

Hello,

The model is the COROS VERTIX

But I have asked the supplied, I cannot read the file at all with fitdecode, it crashes too early

Thank your for your help

FrancoisDupont commented 3 years ago

Hello @polyvertex

I got a similar issue, when the exception is raised I cannot read further records.

Thanks

Kypaz commented 3 years ago

Any update?

inonoob commented 3 years ago

@Kypaz: I've tried your file and it is working with the Garmin SDK FIT CSV Tool - Protocol 2.0 Profile 21.40 Release. I can decode it, open the csv and re-encode it. So It must be the lib from what I have checked.

mastermaeg commented 3 years ago

Hi I got the same error with a fit file from Coros Pace 2. I guess https://github.com/dtcooper/python-fitparse/pull/116 would also fix this here?

polyvertex commented 3 years ago

I've tried your file and it is working with the Garmin SDK FIT CSV Tool - Protocol 2.0 Profile 21.40 Release. I can decode it, open the csv and re-encode it. So It must be the lib from what I have checked.

FYI SDK's tool seems to skip unknown types/fields, such that it goes silent about this kind of errors, whereas both fitdecode and fitparse libraries intend to dig into types definitions. So that they parse FIT data in a stricter way, not permissive with malformed files.

I will add an option flag to enable a more permissive parsing that still proceed when possible.