-
Notifications
You must be signed in to change notification settings - Fork 129
make kml_export multi OS #171
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
Conversation
replaced mkdir, xdg-open, xdg-user-dir
I don't use the map feature in dt at all, so I don't really know what exactly this is supposed to do or what I need (aside from ImageMagick) for this to work. If you explain a bit I can try to test sometime this week. |
contrib/kml_export.lua
Outdated
if not df.check_if_bin_exists("mkdir") then | ||
dt.print_error(_("mkdir not found")) | ||
return | ||
end | ||
if not df.check_if_bin_exists("convert") then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At first glance I suspect check_if_bin_exists('convert') will fail on windows. I have always had to put a file chooser in the preferences so the user can point to the program and then perform a dt.preferences.write('executable_paths', 'someprogram', dir) for check_if_bin_exists('someprogram') to work on windows. It seems as though when installing programs on windows they are not automatically visible to dt in the way they are on linux machines.
@wpferguson please correct me if I'm wrong here as I'm not 100% certain. If there is a way around this I would love to know, as I'm currently trying to access dts exiv2 but can't figure out how.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@BzKevin sounds reasonable. I'll look into that and a preference.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I pushed a new version
contrib/kml_export.lua
Outdated
dt.print_error(_("xdg-user-dir not found")) | ||
return | ||
if dt.configuration.running_os == "windows" then | ||
if not df.check_if_bin_exists("xdg-user-dir") then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar to my comment above, my experience has been this will fail unless you provide the user a way to specifically define a directory for this and at some point do a dt.preferences.write.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this was stupid, the right syntax must be
if dt.configuration.running_os == "linux" then
This script creates an KML file (XML file for google earth) with the selected images. It works only with imagers, that have GPS information. I blogged some time ago about this script here. |
kml_export added preference for path to convert as windows programs are not by default in the PATH
the command "convert" is deprecated and replaced by "magick"
kml_export: use more utility functions as suggested by @wpferguson
The next step on my ToDo list is to refactor the preferences. @wpferguson I had a change to test with Windows and it looks like we have a problem with dsys.launch_default_app(path). launch_default_app() adds double quotes around the filename and that does not work here. |
I almost pulled that back when I merged video_ffmpeg, because I thought that might happen. I have a fix in mind, so let me code it, test it, and I'll push it in 10 or 12 hours. |
Fixed, pushed, and merged. |
dsys.launch_default_app(df.sanitize_filename(path))
df.mkdir(df.sanitize_filename(xportDirectory..PS..imageFoldername))
I can do some testing over the weekend unless @wpferguson feels like doing it sooner. I'll need some files with GPS coordinates though if you can provide some @supertobi |
@BzKevin Thanks, I'll add some example images and my last version tomorrow. |
Here the test images: |
Ok. I tested it. There is a small error I noted up already (an 'e' missing from line 103). It appears to work, however, there may be an issue. I am to unfamiliar to know. I opened the exported kml in Google Earth and the images thumbnails show up properly. However, when I click on an image I don't get a larger view, just a '?' |
Fixed Windows problem
replaced mkdir, xdg-open, xdg-user-dir
I've coded this without windows for testing.
@wpferguson or @BzKevin could you please test if this works.