[Digikam-users] about "synchronizing XMP sidecars and the digiKam database"
jean-francois.rabasse at wanadoo.fr
Thu Feb 21 18:36:16 GMT 2013
Some comments :
> and a shell script runs automatically every ten minutes and:
> - if digikam is running, set a RESYNC flag
> - if digikam is NOT running and RESYNC is set (i.e. max ten minutes
> after you closed DK))
Hem, if you idea, as far as I understand, is to start synchronization
job after Digikam session, the above seems very complicated.
Why not have a two lines script, let's call it "startdk", with :
digikam && start-my-sync-script
To work with DK, you run startdk. And when you leave DK correctly (i.e.
no crash or so) your script starts. Immediately, not 10 mnn later.
On Thu, 21 Feb 2013, M. Fioretti wrote:
> In other words, what matters is only:
> 1) where the stuff is (Sqlite or MySql db) or must go (image/sidecar
> file) and what the exact formatting must be in each place
> 2) if there is some nasty side-effect
> I know how to do (1): there are standard command line tools to extract
> data from either Sqlite or MySql databases, regardless of _who_ put
> them there; other tools to reformat those records, and exiftool to
> write the results in the right places, and I know how to use this
> stuff. What I don't know is (2), and what is the fastest way to find
> the formatting information: the one you mention:
Right, you can extract data from any database, with the proper tools,
but to be able to exploit that data you need the database schema.
How to build the list of tags associated with such image, etc. This
implies issuing select, join, et al.
So, you should first dump the database schema, study it, and organise your
But it's technicaly possible (if it's worth the work).
And, about what Elle said :
>> Such a script would need constant updating to keep up with the
>> latest digiKam/exiv2.
> Why? If I understand correctly, there is no more "constant updating"
> to do in this that in the commands you use now. digiKam and exiv2 can
> change as much as they want internally, but as long as the strings
> they write remain the same we don't care, do we now?
Sure you care. If across a DK version change, the schema changes,
(it has already happened) you have to adapt your script(s).
As for point 2, possible side-effects, It shouldn't happen, but on one
point : timing !
What you describe, tools to extract, then tools to reformat, then tools
to write, exiftool et al., is all heavy processing. Scripting is powerful
but slow, exiftool is a powerful tool but slow (Perl, not compiled code).
I really doubt you do process one image that way in less than 0.5 or 1
second. It's peanuts, yes, when run once. When you will have to process
a database of 10000 images, it will last hours.
> Besides, if one has a lot of pictures, even changes whenever exiv2 or
> digiKam _change_ should be way quicker and less boring than all the
> manual configuration changes at each digiKam _session_.
Should be « way less boring », perhaps. But « quicker » ?
More information about the Digikam-users