Eu queria receber esses avatares do Skype também, então usei a resposta do whitequark para fazer um pequeno script que faz exatamente isso. Aqui está:
#!/bin/bash
if [ \( $# -lt 1 \) ];
then
echo "Usage: $0 folder";
echo "Where folder is of the form /home/username/.Skype/username";
exit;
fi;
for i in 'ls $1';
do
if [ -f $1/$i ];
then
#echo "i: $i";
filedump='hexdump -v -e '"" 1/1 "%02x" ""' $1/$i | sed -e 's/ffd8ffe0/\nffd8ffe0/g'';
nocc='echo "$filedump" | wc -l'; # occurences of the \n char. Means that there are nocc-1 occurences of our word
#echo "nocc: $nocc";
if [ "$nocc" -ge 2 ];
then
k=0;
old_IFS=$IFS; #field separator
IFS=$'\n';
offset=0;
for j in $filedump;
do
w='echo $j | wc -m'; # gives actually lettercount+1
w=$[w-1];
offset=$[offset+w];
#echo "offset: $offset";
filename1="${i}_${k}_notclean.jpg";
filename2="${i}_${k}.jpg";
dd ibs=1 if=$1/$i of=$filename1 skip='echo "$offset/2" | bc' status=noxfer;
if [ 'du $filename1 | cut -f1' -gt 0 ];
then
convert $filename1 $filename2; #convert is actually only used to remove the data after the image
fi;
rm $filename1;
k=$[k+1];
done;
IFS=$old_IFS;
fi;
fi;
done