Difference between revisions of "How to recover and sort photos from a broken disk or deleted photos"

From Urandom
Jump to: navigation, search
(Created page with "So after recovering images from a broken disk I ended up with a pile of unsorted images. Sorting them into folders by image size helped a lot to distinguish album art or thumb...")
 
Line 1: Line 1:
So after recovering images from a broken disk I ended up with a pile of unsorted images. Sorting them into folders by image size helped a lot to distinguish album art or thumbnails from actual pictures.
+
So after recovering images from a broken disk I ended up with a pile of unsorted images. Sorting them into folders by image dimensions helped a lot to distinguish album art or thumbnails from actual pictures.
 
You will also have to have imagemagic installed.
 
You will also have to have imagemagic installed.
 
<pre>
 
<pre>

Revision as of 08:38, 14 April 2014

So after recovering images from a broken disk I ended up with a pile of unsorted images. Sorting them into folders by image dimensions helped a lot to distinguish album art or thumbnails from actual pictures. You will also have to have imagemagic installed.

cd /folder/with/pictures

ls -1 | while read line
do 
size=`identify $line | cut -d" " -f3`

if [ "" != "$size" ]
then
if [ ! -d $size ]
then
mkdir $size
fi                                                                                                                                                                                 

echo "Moving $line  to folder $size"
mv $line $size/
else
echo "Skiping $line"
fi
done