[Digikam-devel] [Bug 109820] Offer: Utility script to export tag information of images into the filesystem

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[Digikam-devel] [Bug 109820] Offer: Utility script to export tag information of images into the filesystem

Bugzilla from ahlgren@mit.edu
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
         
http://bugs.kde.org/show_bug.cgi?id=109820         




------- Additional Comments From ahlgren mit edu  2006-08-02 21:16 -------
> Your suggestion to create an option for let me call it "archiving" the tag
> structure in an extra directory containing a  Linktree and a Photos
> subdirectory and using hard links will solve the problems for this scenario.

Yes, exactly. Just to be sure we're on the same page:
{linktree} <--[symbolic links]--> {photo directory} <--[hard links]--> {digiKam collection}

This scheme (called an indirection layer) will solve the problem.

> However one limitation to this solution is that hard links are bound to
> filesystems, so the archive directory has to be on the same filesystem as the
> original photos because hardlins can only be created in one filesystem and
> not across filesystem boundaries.

Not exactly; it still works beautifully (I have tested it infact). Here's a proof of concept:




>> Step 1) Create a fake DigiKam photos directory.
mats moonfish:~
$ mkdir Pictures

mats moonfish:~
$ echo "test: 123" > Pictures/example.jpg


>> Step 2) Simulate proposed modifications to your script.
mats moonfish:~
$ mkdir DigiKamExport

mats moonfish:~
$ mkdir DigiKamExport/linktree

mats moonfish:~
$ mkdir DigiKamExport/photos

mats moonfish:~
$ ln Pictures/example.jpg DigiKamExport/photos/hard-link-to-example.jpg

mats moonfish:~
$ cd DigiKamExport/linktree/

mats moonfish:~/DigiKamExport/linktree
$ ln -s ../photos/hard-link-to-example.jpg soft-relative-link-to-hard-link-to-example.jpg

mats moonfish:~/DigiKamExport/linktree
$ cat soft-relative-link-to-hard-link-to-example.jpg
        test: 123

> What the test setup looks like...
mats moonfish:~
$ ls -CFRl DigiKamExport/
        DigiKamExport/:
        total 8
        drwxr-xr-x 2 mats mats 4096 2006-08-02 14:55 linktree/
        drwxr-xr-x 2 mats mats 4096 2006-08-02 14:52 photos/
       
        DigiKamExport/linktree:
        total 0
        lrwxrwxrwx 1 mats mats 34 2006-08-02 14:55 soft-relative-link-to-hard-link-to-example.jpg -> ../photos/hard-link-to-example.jpg
       
        DigiKamExport/photos:
        total 4
        -rw-r--r-- 2 mats mats 10 2006-08-02 14:52 hard-link-to-example.jpg
       
       
>> Step 3) Create a tarball-gzip archive of DigiKamExport to export to a friend
mats moonfish:~/DigiKamExport/linktree
$ cd ../..

mats moonfish:~
$ tar -cvvzf DigiKamExport.tgz DigiKamExport/
        drwxr-xr-x mats/mats         0 2006-08-02 14:51:12 DigiKamExport/
        drwxr-xr-x mats/mats         0 2006-08-02 14:55:50 DigiKamExport/linktree/
        lrwxrwxrwx mats/mats         0 2006-08-02 14:55:43 DigiKamExport/linktree/soft-relative-link-to-hard-link-to-example.jpg -> ../photos/hard-link-to-example.jpg
        drwxr-xr-x mats/mats         0 2006-08-02 14:52:05 DigiKamExport/photos/
        -rw-r--r-- mats/mats        10 2006-08-02 14:52:49 DigiKamExport/photos/hard-link-to-example.jpg


>> Step 4) Simulate sending file to another computer, and extract it.
mats moonfish:~
$ mkdir AnotherComputer

mats moonfish:~
$ mv DigiKamExport.tgz AnotherComputer/

mats moonfish:~
$ cd AnotherComputer/

mats moonfish:~/AnotherComputer
$ tar -xvvzf DigiKamExport.tgz
        drwxr-xr-x mats/mats         0 2006-08-02 14:51:12 DigiKamExport/
        ...[snip]...


>> Step 5) Proof that the new hard link is an entirely new file, but the symbolic relative link still works.
mats moonfish:~/AnotherComputer
$ cat DigiKamExport/linktree/soft-relative-link-to-hard-link-to-example.jpg
        test: 123

mats moonfish:~/AnotherComputer
$ echo "test2: 456" > DigiKamExport/photos/hard-link-to-example.jpg

> Relative symlink still works on "AnotherComputer".
mats moonfish:~/AnotherComputer
$ cat DigiKamExport/linktree/soft-relative-link-to-hard-link-to-example.jpg
        test2: 456

mats moonfish:~/AnotherComputer
$ cat ../DigiKamExport/
        linktree/ photos/

> The files ~/DigiKamExport/photos/hard-link-to-example.jpg and ~/AnotherComputer/DigiKamExport/photos/hard-link-to-example.jpg are different files now.
mats moonfish:~/AnotherComputer
$ cat ../DigiKamExport/linktree/soft-relative-link-to-hard-link-to-example.jpg
        test: 123
_______________________________________________
Digikam-devel mailing list
[hidden email]
https://mail.kde.org/mailman/listinfo/digikam-devel