msgbartop
A cronological documentation test project, nothing serious, really!
msgbarbottom

09 Apr 2007 md5sum av filer/bilder

For å sikre seg mot at filer er korrupt kan man benytte kommandoen md5sum

Windows

md5sum -b *.JPG > checksum.md5

Linux
Deretter kopierer man denne md5-fila til rett katalog i Linux og tester at disse filene er identisk vha MD5Sums, et grafisk Windows program.

Tags: , ,

Posted by

13 Mar 2007 Script to download pictures from camera and rename them etc

1. download photos from camera and sort them by date of day in folders
2. remove possible duplicates if I did not erase camera images since last download
3. convert RAW/NEF images to a usable format

All this in one single click!

#!/bin/bash
# Change this to where to store Photos
target=/home/multimedia/Images
camera=”USB PTP Class Camera”
date=$(date –iso-8601)
mkdir -p $target/$date/tmp
cd $target/$date/tmp
# Get all photos from camera
gphoto2 –quiet –camera $camera –port usb: -P
# Do not replace photos that were already uploaded this same day
cp -u $target/$date/tmp/* $target/$date
rm -rf $target/$date/tmp
cd $target/$date
# auto-rotate using exif info
exifautotran *.JPG
# If photos were not erased from camera since last upload, remove duplicates
for i in *.{JPG,NEF}; do
for f in $(find $target -name $i ! -samefile $target/$date/$i); do
if md5sum $f | sed -e “s, .*/, ,” | md5sum –check; then
rm -f $i;
fi
done
done
# decode RAW images if not already done ?
# for i in *.NEF; do if [ ! -e $(basename $i .NEF).ppm ]; then dcraw -w $i; fi; done
# Show them!
gimv -d $target/$date

Tags: , , , , , , , , ,

Posted by

02 Feb 2007 Improved watermark script with imagemagick

#!/bin/bash
# Use a shell loop
#mkdir thumbnails
if [ ! -f *.JPG ] ; then
        echo "Ingen filer tilgjengelig!"
else
for file in *.JPG
do
        width=`identify -format %w ${file}`; \
        convert -background '#0008' -fill white -gravity center -size ${width}x90 \
        -font Sketchy  -pointsize 50 \
        caption:"Copyright © 2007 Pario.no" \
        +size ${file} +swap -gravity north -composite  thumbnails/${file};
#       rm ${file}
done
fi

Tags: , , , ,

Posted by

02 Feb 2007 Resize of images in a folder with imagemagick

#!/bin/bash
# Hans-Henry Jakobsen
# Script som bl.a resizer bilder og legger de i rett mappe
# NB! ikke bruk originalfil da dette script sletter fila

# Sjekker at mapper eksisterer
if [ ! -d 320 ]
        then
        mkdir 320
fi
if [ ! -d 480 ]
        then
        mkdir 480
fi

for file in  $(ls|grep JPG)
do
        base320=`basename $file .JPG`_Resized_320.png
        base480=`basename $file .JPG`_Resized_480.png

        convert $file -resize 320 $base320
        convert $file -resize 480 $base480

        #320px
        convert $base320 -background black \
        -font Verdana -pointsize 10 -fill black \
        -gravity center -set caption "Copyright \© 2007 Pario.no"  +polaroid \
        320/$base320;

        #480px
        convert $base320 -background black \
        -font Verdana -pointsize 10 -fill black \
        -gravity center -set caption "Copyright \© 2007 Pario.no"  +polaroid \
        480/$base480;

        # Sletter temp filer
        rm $base320
        rm $base480
        # Ikke bruk originalfil da den blir slettet!
        rm ${file}
done

# Ordner rettigheter
chmod g+rw 320/*
chmod g+rw 480/*
chgrp knausen 320 -R
chgrp knausen 480 -R

Tags: , , , , ,

Posted by