Getting rid of all small (less than 400px across) images
My photo gallery has been moved around so much between so many different apps its become a bit of a mess. In particular there are many duplicate images (but with different filenames) and also many thumbnails of images have become incorporated as images into my gallery. Fspot lets you import images and exclude duplicates. I wrote a little bash script to find all images less that 400px across and move them into a thumbnails directory (which I then deleted), I wrote it as a one liner and it uses gdal to get the image sizes:
mkdir thumbs; for FILE in `find . -name *.jpg`; do SIZE=`gdalinfo $FILE|grep Size`; X=`echo $SIZE | awk ‘{print $3}’|sed ‘s/,//g’`;Y=`echo $SIZE | awk ‘{print $4}’`; if (( “$X” < 400 )); then echo “Its a thumb: $FILE —> $X, $Y”; mv $FILE thumbs/; fi; done