Hi,
I added Name, Description and Keywords in Darktable and exported picture as JPG.
As you can see, Windows shows everything, but not Shutterstock. No problem with Pond5.
maybe open a case with shutterstock why this is missing. could also be a bug on their side.
I just did, letâs wait and see.
But to be sure, is Darktable format compatible with IPTC standard?
Is anybody using Darktable for writing keywrods and description for stock photos?
No, darktable doesnât write IPTC data.
If possible, I would like darktable to stick to XMP metadata, although some services and software might (and do) still expect IPTC.
IPTC is old and outdated, with many drawbacks (like tag length limitations), and while UTF-8 is officially supported, some programs use it, some offer this as an option, and some are using locale charsets, which can be a nightmare when one is using, for instance, a Windows system in a language with some âforeignâ characters.
When necessary, XMP tags can be copied to IPTC via ExifTool and similar programs.
I use a lua script which calls the exiftool after export mainly to copy over the tags as piwigo.org only reads tags from IPTC.
Are you able to run this LUA script with Windows Darktable also?
I tried several locations of lua script (AppData\Local\darktable OR Darktable\share\darktable) and luarc but still canât see any new module in Darktable.
require âexiftool_exportâ
require âlua/exiftool_exportâ
nothing worksâŚ
Thanks for help.
I donât think that would work, the script uses an external program to do its job. That being said, Lua should work on Windows, too, if there is no Unicode character in the path. And thus not in your username.
Windows, well Iâm sitting all day long in front of such a machine, but donât use it for my RAW images to process.
Anyway, I got it working on Win10 with the attached LUA script.
I did following for installation:
- Install exiftool in a place where it can be found if you use the
cmd.exe
from any place. I copiedexiftool.exe
intoC:\Windows\
- in AppData\Local\darktable I made a new folder lua and copied
exiftool_export.lua
into this folder - created a
luarc
and addedrequire "exiftool_export"
exiftool_export_windows.zip (2.0 KB)
From the original version I removed the checking if the exiftool is installed. I also needed to replace '
with "
Sometimes even a blind chicken âŚ
edit: cmd.exe
pops up on every call. That can be a bit annoying I guess âŚ
@pk5dark: Thanks a lot, now LUA is really working:slight_smile:
I can see my tags on Shutterstock after export now, but no description, i need to investigate.
Dam, I forgot to fix that part in the script. So it wonât work with the version above, Sorry.
exiftool_export_windows.zip (2.0 KB)
You need to figure out what else need to be copied.
You can try to use the exiftool with an arguments file. An arguments file can have several options over multiple lines. This is the -@
option, which you should be able select from the modul. There is a kind of official but old sample argument file. If you select the -@
option in the modul, you will get a field for file selection. You can try this file:
@pk5dark: You are right, there was just Keywords to Tags mapping in the LUA script.
Can I add mapping for Title without using argument file? I tried to add -XMP-dc:Title > IPTC:ObjectName mapping into LUA script, but it is not working:
cmd_options[1] = â-XMP-dc:Subject > IPTC:Keywords -XMP-dc:Title > IPTC:ObjectNameâ
@P_Cherry: before fideling with the script, you can try command options directly in the cmd.exe
.
Iâm not an exiftool expert
If I try
exiftool "-XMP-dc:Subject > IPTC:Keywords -XMP-dc:Title > IPTC:ObjectName" image.jpg
in the cmd.exe
I got the error message:
Warning: Invalid tag name 'iptc:keywords -xmp-dc:title > iptc:objectname'
I think it would be much easier to use an arg file. Just create a new txt file (XMPtoIPTC.txt
) and add arguments line by line like:
-XMP-dc:Subject > IPTC:Keywords
-XMP-dc:Title > IPTC:ObjectName
and then try:
exiftool -@ XMPtoIPTC.txt image.jpg
@pk5dark Could you please test if this âcheck_if_bin_existsâ version works with Windows?
function check_if_bin_exists(bin)
local result
if (dt.configuration.running_os == "windows") then
local f=io.open(bin,"r")
if f~=nil then
io.close(f)
return true
else
return false
end
elseif (dt.configuration.running_os == "linux") then
result = os.execute("which " .. bin)
elseif (dt.configuration.running_os == "macos") then
result = os.execute() -- ToDo: We need something here
else
result = false
end
if (not result or result == nil) then
result = false
end
return result
end
if not check_if_bin_exists("exiftool") then
dt.print_error("exiftool not found")
return
else
dt.print_error("exiftool found")
end
LUA ERROR exiftool not found
What
local f=io.open(bin,"r")
should do on Windows?
me donât like to test much on windows
Yes, I know I can use arg file. But I am curious if it is possible to use more arguments directly in exiftool commamnd lineâŚ
Maybe someone expeienced with exiftool itself?
exiftool â-XMP-dc:Subject > IPTC:Keywords -XMP-dc:Title > IPTC:ObjectNameâ image.jpg
in the cmd.exe I got the error message:
Warning: Invalid tag name âiptc:keywords -xmp-dc:title > iptc:objectnameâ
I donât have access to a windows box to test, but this seems to work for me on the command line in Bash:
exiftool -IPTC:Keywords=xmp-dc:Subject -IPTC:ObjectName=xmp-dc:Title image.jpg
I wouldnât think cmd.exe would be that different; maybe just a matter of putting the arguments in quotes?
Are you sure this works in bash?
in cmd.exe I get following IPTC entries:
IPTC
Keywords: xmp-dc:Subject
Application Record Version: 4
Object Name: xmp-dc:Title
which is expected I guess with the =
operator
What
local f=io.open(bin,ârâ)
should do on Windows?
It should, but I donât have a Windows to test. Maybe we need the complete path.
@Tobias There is a PATH variable on windows, but I guess it is not mandatory? So most windows programs which rely on external binaries have some file chooser in the preferences in such cases.
I think so, because programs can be installed in different places and there is no which
command.
OT:
Currently this check_if_bin_exists()
function in the lua scripts is a bit of needless. There is no script/plugin installer, so there is some knowlegde required to install the scripts and users need to read the docs and description. If somethings goes wrong users likely can check themself the error logs. Unfortunately, on windows darktable.print()
is only written to the log file and not printed in the cmd.exe
. dartable.error()
disappears quite fast. So maybe it is not easy to find errors. Once there is a script installer check_if_bin_exists()
would make more sense.
Maybe we should split the thread?