Re: Beagle indexing gthumb comments



Len Trigg wrote:
> I have been using gthumb for ages now to associate comments with my
> digital photos.  I'm fairly happy with it (i.e. am not planning on
[...]
> A second (and probably more important) question: As I understand it,
> beagle will only index/update this information when the image file
> changes, rather than when the xml comment file changes -- is there any
> way to get the correct operation?

What I'm now doing is running the following script from cron.  Not the
nicest, but it seems to work:

-----
#!/bin/sh
# Scan all pics comment files and if the comment file is newer than
# the image, touch the image to have the same time as the
# comment. This is so that beagle will reindex those images.
IMAGE_ROOT=/home/me/Pics/Photos/
find "$IMAGE_ROOT" -wholename '*/.comments/*.xml' | \
while read commentfile; do
    commentdir="$(dirname "$commentfile")"
    dir="$(dirname "$commentdir")"
    file="$(basename "$commentfile")"
    file="${file%.xml}"
    file="$dir/$file"
    if [ ! -f "$file" ]; then
        true #echo "Image $file has gone"
    elif [ "$commentfile" -nt "$file" ]; then
        echo "Updating $file"
        touch "$file" -r "$commentfile"
    fi
done
-----


Cheers,
Len.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]