-
Notifications
You must be signed in to change notification settings - Fork 123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When converting to fit format, a name should be generated if there's none in the original format #876
Comments
Our writers have no idea where any given data element comes from as it may have been filtered, merged, interpolated, etc. So the GPX idea falls a bit flat, but we may be able to work with the name of the fit file we're writing - the file writer definitely knows that. However, we have about a bazillion "name" things in our formats and code. By inspection (I don't think any of my 100+ GPSes do .fit) the only thing that catches my eye as possibly funny is that here: We use the name of the first route we see (which, in GPX parlance would be a ) and that name may or may not exist, but we pass it to Line 1080 in 29b154f
which makes it down to Line 920 in 29b154f
...which looks like it would just write a 0 terminator and then the number of bytes written (1: the terminator) which looks like some kind of FIT thing. Maybe it would be better to not write an empty string? Maybe we need some kind of rte->rte_name.isEmpty() ? "default" : rte->rte_name to just write SOMETHING there. If that basically fixes it, we can figure out how we can clean the output name (which might be usb:: or \share\some\long\name or file:\\c:\some\name or have unsavory punctuation or something, but let's figure out if just writing something is better than writing nothing. Or, if testing that we have nothing and not wrting that at all is better. Since you have the test case and the affected hardware, it'll probably be up to you to do the experimentation. |
Writers can see session information. In the common use case of one input file I think we should be able to recover the input file name. |
It isn't clear to that the name in the course message is what the OP needs on his watch. |
It looks like fit files have a name inside them. At least some devices delete
fit
-files if that is not set.Therefore, in the case the original file does not have a corresponding value I suggest to generate one, e.g. from the filename (maybe discarding the extension)
gpx files can have a
name
tag directly below thegpx
root.When I convert such a file to
fit
and put it on my garmin watch, the watch deletes the file. This should be avoided, hence the suggested workaround.The text was updated successfully, but these errors were encountered: