update to newest API change in master

This commit is contained in:
Jérémy Rosen
2016-04-17 20:46:32 +02:00
parent 204868d733
commit 783194e253
12 changed files with 24 additions and 30 deletions

View File

@@ -186,7 +186,7 @@ local function create_kml_file(storage, image_table, extra_data)
-- Creates dir if not exsists
imageFoldername = "files/"
local mkdirCommand = "mkdir -p "..exportDirectory.."/"..imageFoldername
coroutine.yield("RUN_COMMAND", mkdirCommand)
dt.control.execute( mkdirCommand)
end
@@ -206,11 +206,10 @@ local function create_kml_file(storage, image_table, extra_data)
-- profiles that might be present in the input and aren't needed in the thumbnail.
local convertToThumbCommand = "convert -size 96x96 "..exported_image.." -resize 92x92 -mattecolor \"#FFFFFF\" -frame 2x2 +profile \"*\" "..exportDirectory.."/"..imageFoldername.."thumb_"..filename..".jpg"
-- USE coroutine.yield. It does not block the UI
coroutine.yield("RUN_COMMAND", convertToThumbCommand)
dt.control.execute( convertToThumbCommand)
local concertCommand = "convert -size 438x438 "..exported_image.." -resize 438x438 +profile \"*\" "..exportDirectory.."/"..imageFoldername..filename..".jpg"
coroutine.yield("RUN_COMMAND", concertCommand)
dt.control.execute( concertCommand)
end
-- delete the original image to not get into the kmz file
@@ -321,7 +320,6 @@ local function create_kml_file(storage, image_table, extra_data)
-- Compress the files to create a KMZ file
if ( dt.preferences.read("kml_export","CreateKMZ","bool") == true ) then
exportDirectory = dt.preferences.read("kml_export","ExportDirectory","string")
-- USE coroutine.yield. It does not block the UI
local createKMZCommand = "zip --test --move --junk-paths "
createKMZCommand = createKMZCommand .."\""..exportDirectory.."/"..exportKMZFilename.."\" " -- KMZ filename
@@ -338,7 +336,7 @@ local function create_kml_file(storage, image_table, extra_data)
end
end
coroutine.yield("RUN_COMMAND", createKMZCommand)
dt.control.execute( createKMZCommand)
end
-- Open the file with the standard programm
@@ -350,7 +348,7 @@ local function create_kml_file(storage, image_table, extra_data)
else
kmlFileOpenCommand = "xdg-open "..exportDirectory.."/\""..exportKMLFilename.."\""
end
coroutine.yield("RUN_COMMAND", kmlFileOpenCommand)
dt.control.execute( kmlFileOpenCommand)
end