@@ -92,12 +92,10 @@ local function create_kml_file(storage, image_table, extra_data)
92
92
dt .print_error (_ (" zip not found" ))
93
93
return
94
94
end
95
-
96
95
exportDirectory = dt .configuration .tmp_dir
97
96
imageFoldername = " "
98
97
else
99
98
exportDirectory = dt .preferences .read (" kml_export" ," ExportDirectory" ," string" )
100
-
101
99
-- Creates dir if not exsists
102
100
imageFoldername = " files" .. PS
103
101
df .mkdir (df .sanitize_filename (exportDirectory .. PS .. imageFoldername ))
@@ -119,6 +117,8 @@ local function create_kml_file(storage, image_table, extra_data)
119
117
-- profiles that might be present in the input and aren't needed in the thumbnail.
120
118
121
119
local convertToThumbCommand = ds .sanitize (magickPath ) .. " -size 96x96 " .. exported_image .. " -resize 92x92 -mattecolor \" #FFFFFF\" -frame 2x2 +profile \" *\" " .. exportDirectory .. PS .. imageFoldername .. " thumb_" .. filename .. " .jpg"
120
+
121
+ df .file_copy (exported_image , exportDirectory .. PS .. imageFoldername .. filename .. " ." .. filetype )
122
122
dsys .external_command (convertToThumbCommand )
123
123
else
124
124
-- Remove exported image if it has no GPS data
@@ -142,6 +142,7 @@ local function create_kml_file(storage, image_table, extra_data)
142
142
filmName = string.gsub (filmName , " |" , " " )
143
143
filmName = string.gsub (filmName , " *" , " " )
144
144
filmName = string.gsub (filmName , " ?" , " " )
145
+ filmName = string.gsub (filmName ,' [.]' , " " ) -- At least Windwows has problems with the "." and the start command
145
146
end
146
147
147
148
exportKMLFilename = filmName .. " .kml"
@@ -292,12 +293,21 @@ local function create_kml_file(storage, image_table, extra_data)
292
293
end
293
294
294
295
-- Preferences
295
- dt .preferences .register (" kml_export" ,
296
- " OpenKmlFile" ,
297
- " bool" ,
298
- _ (" KML export: Open KML/KMZ file after export" ),
299
- _ (" Opens the KML file after the export with the standard program for KML files" ),
300
- false )
296
+ if dt .configuration .running_os == " windows" then
297
+ dt .preferences .register (" kml_export" ,
298
+ " OpenKmlFile" ,
299
+ " bool" ,
300
+ _ (" KML export: Open KML file after export" ),
301
+ _ (" Opens the KML file after the export with the standard program for KML files" ),
302
+ false )
303
+ else
304
+ dt .preferences .register (" kml_export" ,
305
+ " OpenKmlFile" ,
306
+ " bool" ,
307
+ _ (" KML export: Open KML/KMZ file after export" ),
308
+ _ (" Opens the KML file after the export with the standard program for KML files" ),
309
+ false )
310
+ end
301
311
302
312
local defaultDir = ' '
303
313
if dt .configuration .running_os == " windows" then
@@ -344,7 +354,11 @@ if dt.configuration.running_os == "linux" then
344
354
end
345
355
346
356
-- Register
347
- dt .register_storage (" kml_export" , _ (" KML/KMZ Export" ), nil , create_kml_file )
357
+ if dt .configuration .running_os == " windows" then
358
+ dt .register_storage (" kml_export" , _ (" KML Export" ), nil , create_kml_file )
359
+ else
360
+ dt .register_storage (" kml_export" , _ (" KML/KMZ Export" ), nil , create_kml_file )
361
+ end
348
362
349
363
-- vim: shiftwidth=2 expandtab tabstop=2 cindent syntax=lua
350
364
-- kate: hl Lua;
0 commit comments