Archive for the 'f-spot' Category

Rebuild f-spot on Ubuntu Hardy

Got source files from
https://launchpad.net/ubuntu/+source/f-spot

Add the lines above to ubuntu sources..

echo "deb http://ppa.launchpad.net/ruben/ubuntu hardy main" | sudo tee -a /etc/apt/sources.list
echo "deb-src http://ppa.launchpad.net/ruben/ubuntu hardy main" | sudo tee -a /etc/apt/sources.list

Install missing libs:

apt-get install cli-common-dev mono-gmcs libmono-dev libmono-system-runtime2.0-cil 
apt-get install libgnome-keyring1.0-cil libusb-dev libgphoto2-2-dev 
apt-get install libglitz1-dev libglitz-glx1-dev gtk-sharp2-gapi mono-mcs
apt-get install gtk-sharp2-gapi
apt-get install libglib2.0-cil

Clean up the mess and rebuild it..

rm -rf f-spot-0.5.0.3
dpkg-source -x f-spot_0.5.0.3-0ubuntu4.dsc
cd f-spot-0.5.0.3
dpkg-buildpackage -rfakeroot -b

Find (new) images that does not exist in the f-spot database.

Here is a small script which will give some ideas of how it can be done:

 
# Backup your f-spot db-file to /tmp/
cp ~/.gnome2/f-spot/photos.db /tmp/
 
# Run a sql to find the photos matching my photo uri+2008, and 'DSC*.jpg'.
# split the list that sqlite3 generates. I just want the photo name, so that's my 10'th field.
# Uppercase every filename and sort it, then put it into a file.
sqlite3 ~/.gnome2/f-spot/photos.db 'select uri from photos where uri like "file:///home/%/Photos/2008/%DSC%.jpg"' | cut -d/ -f10 | tr 'a-z' 'A-Z' | sort > /tmp/gotFromFspot.list
 
# Go to the directory where you have your camera files. (ps: You should not have photos from 2008 in this directory.
cd /media/PHONE CARD/DCIM/100MSDCF/
 
# find all files and put them into another list.. 'CardFileList.list'
ls -1 | sort > /tmp/CardFileList.list
# Diff the file lists. We only care about the ones that does not exist in gotFromFspot.
diff /tmp/gotFromFspot.list /tmp/CardFileList.list | grep ">" | sed s/> //gi >/tmp/ResultList.list
 
mkdir /tmp/NewImagesTmpDestination
# Loop every file and copy the new, not existing in the f-spot photo db to /tmp/d/
for tmpvariable in `cat /tmp/ResultList.list'; do  cp $tmpvariable /tmp/NewImagesTmpDestination ; done