1

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.

5

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 < 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.

  • Perhaps someone also knows how to extract the images from thumbdata5 files... this script gives some results, but they are a bit broken. (And the thumbdata files are big, but the extracted files make up much less in size.) – imz -- Ivan Zakharyaschev Aug 19 '15 at 19:55
  • 1
    @imz--IvanZakharyaschev : The thumdata file is a sparse file. Open it with hexdump. While the file is large, there aren't many thumbnails in it. – retrohacker Feb 16 '17 at 21:55

protected by Community Oct 20 '15 at 13:54

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.