Export images to other applications

Hello,

I really like the Digikam Software and would like to use it as a DAM from which I can open images with other image editing programs (open source and commercial).

Currently, there is an option to use the internal “Open with” command of Windows, and I think on Linux it is similar. This option is unfortunately not sufficient for several use cases. For example, currently it is not possible to select multiple images to open with an external program. Also the behaviour is not the same. For example, if I use other (freeware, but not open source like XnView) image viewers to send an image to the raw processor DxO Photolab, the image opens directly, or if several images are selected, a virtual album is created. I am not sure how that is being handled, I do not think that XnView made any specific adjustments for DxO Photolab.

In general, it would be nice to have the option to export to different applications with these advanced features. An option would maybe be to have Export Plugins, not for online services, but other installed programs? I would be willing to contribute this, I would only like to know if creating an export plugin would be the right approach to this?

Most of these solutions when transferring are creating an intermediate Tiff to be opened in the other software and then if sending it back saving a tiff for the return trip… I am not sure if this is the use case you are looking for exactly …the open with is picking an application using the OS… I guess you would like that from DK…but you will in any case generally get a tiff back in most cases I think??

I think that depends on the software you call. Darktable doesn’t send anything back, unless you tell it to.

Specifically, it doesn’t provide a thumbnail of the edited version, nor does it return duplicates. That is completely to be expected, btw, given how the two programs work. But it shows that what is returned is not determined by digikam…

Problem with calling other programs in a more advanced way are:

  • there are too many potential candidates to write an interface for each of them (each with its own expectations regarding its input);
  • for some it’s just not possible to write such an interface with a reliable return (e.g. in dt, user can always block export);
  • such interfaces are brittle, in that any change in the target program can break them.

Depending on your needs, full round-trip editing isn’t complicated. I use digiKam for organising and darktable for editing, and it works fine. Simply set DK up to automatically refresh when changes are detected, and be careful not to edit any metadata while DT is open (since it will likely overwrite those changes). Something similar should work for most programs.

As for exporting/opening several images at once, DK simply needs an option to launch other programs with a custom command. Like this:

program -arg %s

%s being a placeholder for the paths of all selected files.

Edit:

Actually, DK is perfectly capable of sending several files at once to other programs, at least on Linux. Simply select them and use the “Open with…” option in the context menu. Just tested it with DT.

1 Like

Been doing some more testing, and it turns out that DK is indeed weird/buggy.

What happens is that instead of doing

program "path1" "path2" "path3" "etc"

it does

program "path1"
program "path2"
program "path3"
program "etc"

That is, it calls the external program once for each file, instead of being sensible and just calling it once with all the files. Some programs handle this fine, but others, like my shell script here, don’t.

The “Run in terminal” option also seems to be broken. It launches the program, but the terminal window never shows.

#!/bin/sh

echo "Prints all arguments passed to the script"
echo "== PWD =="
echo "== PWD ==" >> $HOME/print-args.txt
pwd
pwd >> $HOME/print-args.txt
echo '== $@  =='
echo '== $@  ==' >> $HOME/print-args.txt
echo "$@"
echo "$@" >> $HOME/print-args.txt
echo "========="
echo "=========" >> $HOME/print-args.txt

for var in "$@"
do
    echo "$var"
    echo "$var" >> $HOME/print-args.txt
done

echo "==================" >> $HOME/print-args.txt

Thank you all for your replies. I am actually not even looking for a round-trip, it is much simpler, I just want to open the file in an external application. On Windows, the “Open With” option is only available, when a single image is selected and disappears, when more than one image is selected. Additionally, for some programs the “Open With” behaves differently than passing the images to the program over a command line.

So what I would like is very simple, basically a simple command line call:

A plugin, that lets you define the path to an external application and that passes the absolute image paths of the selected images to the command.

E.g.:

"C:\Program Files\DxO\DxO PhotoLab 5\DxO.PhotoLab.exe" "C:\Users\XXX\Desktop\image1.jpg" "C:\Users\XXX\Desktop\image2.jpg" 

Optionally, to cater for special needs, it could also be possible to add individual commands, I don’t need this personally at the moment, but it could look for example like this, that you could define some building blocks in the plugin:

PROGRAM_PATH IMAGEPATHS "-custom_command"

It would be nice to be able to define several commands, each with an individual shortcut and icon in the export tab, so I could define several different programs to open the files with.

@dkdeveloper ping

Seems like this should interest you.

Darktable has a lua script to do this,. ie use an external editor. I will have to confirm that it will handle multiple files…it has I think 9 configurable command lines so you could perhaps just use say 1-4 for DXO with 4 different conmmand line parameter sets… This is not in DK though which I think is what you want…