[KPhotoAlbum] Is image corruption check possible?

Tero Tilus tero.tilus at jyu.fi
Fri Jan 19 10:36:51 GMT 2007


2007-01-18 18:29, Marco Colnaghi:
> As I understand In Maintenance menu the command "Recalculate
> Checksum" generates and stores new checksums for images.
>
> Is it possible to use KPA checksum feature to check for image
> corruption?

AFAIK no (but I could be wrong), it just recalculates checksums and
replaces previous.  KPA calculates checksum when it first discovers a
new image and stores it to index.xml.  You have the original checksums
in your index.xml.

You can check your files against checksums in index.xml using standard
command line tools.  First you have to pull the checksums and
filenames from index.xml and save them to separate file using md5sum
output format (a line looks like: checksum filename)

I did pulling with grep and sed (this spell works if image start tag
is on single line and md5sum attribute comes before file attribute)

$ grep '<image '  index.xml \
  | sed 's/^[^>]*md5sum="\([^"]*\)"[^>]*file="\([^"]*\)".*$/\1 \2/' \
  > index.md5

Now you can check current files against checksums in index.xml using
md5sum

$ md5sum -c index.md5

-- 
Tero Tilus ## http://www.iki.fi/tero.tilus/



More information about the Kphotoalbum mailing list