2

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.

1 Answer 1

6

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.

2
  • 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.) Aug 19, 2015 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. Feb 16, 2017 at 21:55

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .