[Digikam-users] custom filter for files

Jean-Fran├žois Rabasse jf at e-artefact.eu
Thu Oct 24 13:39:23 BST 2013

On Thu, 24 Oct 2013, Yuri Samoilenko wrote:

> Yes you're right.
> About use case: i want send some photos over internet as one(may be
> encrypted) file

Well, hope someone could help you with a more regular technique, but
the trick I mentionned, using the clipboard as an interface, is very
simple to achieve the above.

- Select yous images in Digikam, then Ctrl-C to copy to clipboard.
- In a terminal window, run a script and feed it with your filenames
   with Shift-Ctrl-V.
   Add a final Ctrl-D to close standard input when you're done.
   (Note that you can issue several selections in DK, and copy/paste
   one after the other, before the final Ctrl-D)

The script itself could be very simple, two lines :

cat | sed 's'?file:..//' > /tmp/temp-names
tar czv --file=photos.tgz --files-from=/tmp/temp-names

One line to read standard input, drop the leading URI mark, save
into a temporay file.
One line to build the archive with files from the temporary file.

Of course, you can make it more sophisticated, add extra processing
(resizing images with convert, add extra metadata with exiftool, etc.)

It's a somewhat rough technique, but you have maximum flexibility as
you master the script, and can do anything. And once the script is
written, it's very fast.


More information about the Digikam-users mailing list