Read content of .thumbdata file I don't know how I managed to delete all my pictures and unfortunately, it took me a few days to find out they where gone. I tried to recover them with DiskDigger, but I didn't have much luck with it (most of them were damaged).

I found 2 400Mb+ files called .thumbdata in the DCIM\.thumbnails folder and I was wondering if there is a way to extract data/thumbnails from it.
It contains 96x96 pixel versions of your photos. The file is simply a concatenation of JPEG files. You can split it into individual JPG files by searching for the signatures indicating the start and end of a JPG file, i.e. the two bytes FF D8 for the start and FF D9 as the end. If you can transfer the file to your computer and you can access Python, the following Python code will extract the files (name the file thumbdata3.dat):

#!/usr/bin/python

"""extract files from Android thumbdata3 file"""

f=open('thumbdata3.dat','rb')
tdata = f.read()
f.close()

ss = '\xff\xd8'
se = '\xff\xd9'

count = 0
start = 0
while True:
    x1 = tdata.find(ss,start)
    if x1 &lt; 0:
        break
    x2 = tdata.find(se,x1)
    jpg = tdata[x1:x2+1]
    count += 1
    fname = 'extracted%d03.jpg' % (count)
    fw = open(fname,'wb')
    fw.write(jpg)
    fw.close()
    start = x2+2


The program will save the files with the names extractednnn.jpg, where nnn is a number.