Created clear_GPS to clear GPS data from selected images.
This commit is contained in:
75
contrib/clear_GPS.lua
Normal file
75
contrib/clear_GPS.lua
Normal file
@@ -0,0 +1,75 @@
|
||||
--[[
|
||||
|
||||
clear_GPS.lua - export and edit with GIMP
|
||||
|
||||
Copyright (C) 2016 Bill Ferguson <wpferguson@gmail.com>.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
]]
|
||||
--[[
|
||||
clear_GPS - clear GPS data from selected image(s)
|
||||
|
||||
This shortcut removes the GPS coordinate data from the selected images.
|
||||
|
||||
ADDITIONAL SOFTWARE NEEDED FOR THIS SCRIPT
|
||||
* None
|
||||
|
||||
USAGE
|
||||
* require this script from your main lua file
|
||||
* select an image or images
|
||||
* click the shortcut, clear GPS data
|
||||
|
||||
BUGS, COMMENTS, SUGGESTIONS
|
||||
* Send to Bill Ferguson, wpferguson@gmail.com
|
||||
|
||||
CHANGES
|
||||
]]
|
||||
|
||||
local dt = require "darktable"
|
||||
local gettext = dt.gettext
|
||||
|
||||
-- not a number
|
||||
local NaN = 0/0
|
||||
|
||||
dt.configuration.check_version(...,{3,0,0})
|
||||
|
||||
|
||||
-- Tell gettext where to find the .mo file translating messages for a particular domain
|
||||
gettext.bindtextdomain("clear_GPS",dt.configuration.config_dir.."/lua/")
|
||||
|
||||
local function _(msgid)
|
||||
return gettext.dgettext("gimp_shortcut", msgid)
|
||||
end
|
||||
|
||||
local function clear_GPS(images)
|
||||
for _, image in ipairs(images) do
|
||||
-- set the location information to Not a Number (NaN) so it displays correctly
|
||||
image.elevation = NaN
|
||||
image.latitude = NaN
|
||||
image.longitude = NaN
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
dt.gui.libs.image.register_action(
|
||||
_("clear GPS data"),
|
||||
function(event, images) clear_GPS(images) end,
|
||||
"clear GPS data"
|
||||
)
|
||||
|
||||
dt.register_event(
|
||||
"shortcut",
|
||||
function(event, shortcut) clear_GPS(dt.gui.action_images) end,
|
||||
"clear GPS data"
|
||||
)
|
||||
28
contrib/de_DE/LC_MESSAGES/clear_GPS.po
Normal file
28
contrib/de_DE/LC_MESSAGES/clear_GPS.po
Normal file
@@ -0,0 +1,28 @@
|
||||
# SOME DESCRIPTIVE TITLE.
|
||||
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
|
||||
# This file is distributed under the same license as the PACKAGE package.
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
||||
#
|
||||
#, fuzzy
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: PACKAGE VERSION\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2016-09-07 22:25-0400\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: Bill Ferguson <wpferguson@gmail.com>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
"Language: \n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=CHARSET\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Generator: Poedit 1.5.4\n"
|
||||
"Language: de_DE\n"
|
||||
"X-Poedit-SourceCharset: UTF-8\n"
|
||||
"X-Poedit-KeywordsList: gettext;dgettext:2;dcgettext:2ngettext:1,2;"
|
||||
"dngettext:2,3\n"
|
||||
"X-Poedit-Basepath: .\n"
|
||||
|
||||
#: clear_GPS.lua:62
|
||||
msgid "clear GPS data"
|
||||
msgstr "löschen GPS-Daten"
|
||||
Reference in New Issue
Block a user