Script to regularly export (new) matching images?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Script to regularly export (new) matching images?

Jens Benecke-2
Hello,

I collect all our family photos in Digikam (two cameras, three mobile phones, two tablets, and occasional screenshots or images mailed to us).
I then geotag, tag and rate them. One of the tags is „for friends“ of which I would like matching images to (automatically) be copied onto a SMB share on our NAS when images are added. I do not want to create copies within the Digikam hierarchy and I do not want to do this manually (unless it is done with a single mouse click).

I imagine a command line image selection / export tool bundled with Digikam could do the trick which would output paths of matching images selected by criteria (tags would be sufficient). This can then be used in scripts. For example,

        digikam-select -c „Default“ -t „for friends“

would output a list of files in collection „Default“ with tag „For friends“ with (relative) paths. E.g.

        2016/July/IMG0192.JPG
        2016/September/DCIM0992.JPG
        ...

This could then be used to keep an external archive of (possibly reduced) JPG files automatically like I described above. For example,

        #!/bin/bash
        digikam-select -c „Default“ -t „for friends“ | while read FILE ; do
                test -f /media/my-SMB-share/Digikam-export/„$FILE“ && continue
                # … create directory if it doesn’t exist …
                convert -quality 80 „$FILE“ /media/my-SMB-share/Digikam-export/„$FILE“
        done

Does something like this exist already or is planned?
If not, would you accept such a tool in Digikam? I could at least write a companion script (in Ruby or Perl) with similar functionality.

Thanks!

Regards

--
Jens Benecke - [hidden email]
Keine Lust auf Müll in ihrem Postfach? www.spamfreemail.de
Reply | Threaded
Open this post in threaded view
|

Re: Script to regularly export (new) matching images?

Gilles Caulier-4


2016-12-24 0:04 GMT+01:00 Jens Benecke <[hidden email]>:
Hello,

I collect all our family photos in Digikam (two cameras, three mobile phones, two tablets, and occasional screenshots or images mailed to us).
I then geotag, tag and rate them. One of the tags is „for friends“ of which I would like matching images to (automatically) be copied onto a SMB share on our NAS when images are added. I do not want to create copies within the Digikam hierarchy and I do not want to do this manually (unless it is done with a single mouse click).

I imagine a command line image selection / export tool bundled with Digikam could do the trick which would output paths of matching images selected by criteria (tags would be sufficient). This can then be used in scripts. For example,

        digikam-select -c „Default“ -t „for friends“

would output a list of files in collection „Default“ with tag „For friends“ with (relative) paths. E.g.

        2016/July/IMG0192.JPG
        2016/September/DCIM0992.JPG
        ...

This could then be used to keep an external archive of (possibly reduced) JPG files automatically like I described above. For example,

        #!/bin/bash
        digikam-select -c „Default“ -t „for friends“ | while read FILE ; do
                test -f /media/my-SMB-share/Digikam-export/„$FILE“ && continue
                # … create directory if it doesn’t exist …
                convert -quality 80 „$FILE“ /media/my-SMB-share/Digikam-export/„$FILE“
        done

Does something like this exist already or is planned?

From digiKam developer : no.
 
If not, would you accept such a tool in Digikam? I could at least write a companion script (in Ruby or Perl) with similar functionality.

Sure. There is a directory in application to host 3rdparty scripts, but we don't maintain code.


The problematic of this solution is the difficulty to have scripts updated in time. A git access must used or a request to developers need to be sent.

Perhaps it's time to use a github repository to host all scripts which will be more easy to maintain in time for end-users ?

Best

Gilles Caulier
Reply | Threaded
Open this post in threaded view
|

Re: Script to regularly export (new) matching images?

Simon Cropper-4
On 24/12/16 19:01, Gilles Caulier wrote:


2016-12-24 0:04 GMT+01:00 Jens Benecke <[hidden email]>:
Hello,

I collect all our family photos in Digikam (two cameras, three mobile phones, two tablets, and occasional screenshots or images mailed to us).
I then geotag, tag and rate them. One of the tags is „for friends“ of which I would like matching images to (automatically) be copied onto a SMB share on our NAS when images are added. I do not want to create copies within the Digikam hierarchy and I do not want to do this manually (unless it is done with a single mouse click).

I imagine a command line image selection / export tool bundled with Digikam could do the trick which would output paths of matching images selected by criteria (tags would be sufficient). This can then be used in scripts. For example,

        digikam-select -c „Default“ -t „for friends“

would output a list of files in collection „Default“ with tag „For friends“ with (relative) paths. E.g.

        2016/July/IMG0192.JPG
        2016/September/DCIM0992.JPG
        ...

This could then be used to keep an external archive of (possibly reduced) JPG files automatically like I described above. For example,

        #!/bin/bash
        digikam-select -c „Default“ -t „for friends“ | while read FILE ; do
                test -f /media/my-SMB-share/Digikam-export/„$FILE“ && continue
                # … create directory if it doesn’t exist …
                convert -quality 80 „$FILE“ /media/my-SMB-share/Digikam-export/„$FILE“
        done

Does something like this exist already or is planned?

From digiKam developer : no.
 
If not, would you accept such a tool in Digikam? I could at least write a companion script (in Ruby or Perl) with similar functionality.

Sure. There is a directory in application to host 3rdparty scripts, but we don't maintain code.


The problematic of this solution is the difficulty to have scripts updated in time. A git access must used or a request to developers need to be sent.

Perhaps it's time to use a github repository to host all scripts which will be more easy to maintain in time for end-users ?

Best

Gilles Caulier

The simplest way of doing this is to use a script. Collections are just directories and tags can be extracted easily using exiv2 (http://www.exiv2.org/) or exiftools (http://www.sno.phy.queensu.ca/~phil/exiftool/).



--
Cheers Simon

Simon Christopher Cropper
Mobile: 0431 821 566
Email: [hidden email]
Online CV: http://www.simonchristophercropper.com/
LinkedIn: http://au.linkedin.com/in/simonchristophercropper/
ResearchGate: https://www.researchgate.net/profile/Simon_Cropper3