Skip to content

Handling of strange .fit files with no body length #27

@jonasinn

Description

@jonasinn

Hi,

I am currently working on a bit of a toolbox utilizing your library and it is super. The goal for my toolbox is to get all my historical data in to a format where I can work with it, so currently a sql database, but lets see how that goes...

What I ran in to with quite a few files is that they seem to have strange headers with 0 data length and 0 crc, the one I had a bit of a deep dive into was from my old Garmin 1000.

Maybe it is expected behaviour to have the library error out in this case but I forked the library and bodged a bit around. Inside the broken file the data seems OK so I would be keen to hear your opinion if some sort of feature to handle this could be added or if I should except these errors and try to fix them outside the library.

Some things I noticed:

  • The one file I tested had only the CRC missing, so the EOF error was triggered in at the end of the file where it tried to read 2 bytes but got 0.
  • The header has 0x00 for all 4 body size bytes and both crc bytes

Cheers,
Jonas

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions