Solved

Extract thumbnails from thumbs.db

Posted on 2003-12-10
11
54,182 Views
Last Modified: 2013-12-03
I know this question has already been asked and never answered, but I'm trying again in case someone who is new in EE knows the answer, do anyone knows how to extract images from thumbs.db file (not generating new ones, extracting them from the file itself) and if possible using C++ / MFC ? (any kind of answer will do if it works!)
0
Comment
Question by:TiCpu
11 Comments
 
LVL 23

Assisted Solution

by:Roshan Davis
Roshan Davis earned 100 total points
ID: 9925867
These links will not extract thumbnails from .db file, but some thumnail viewers

http://www.codeproject.com/listctrl/ThumbsViewer.asp
http://www.codeproject.com/vcpp/gdiplus/GdiPThumbnailsViewer.asp

Rosh :)
0
 
LVL 1

Author Comment

by:TiCpu
ID: 9929846
Not exactly what I wanted, it looks like it will do the same as other question about this file, let's be more specific: if I was only having this file and wanted to extract images from it, how could I do ?
This way it would be much more faster to see content of a remote folder than downloading each images to thumbnail them or looking at them using remote UPC path (\\computer\folder) and setting it to thumbnail, I don't know why it's so slow to see them this way.
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 9946522
From a googlegroups thread:
http://groups.google.com/groups?&selm=3e653daf%241_7%40news.meganetnews.com

      Thumbs.db is  astructured storage with an index stream named "Catalog" and numbered
      streams containing the thumbnails. This is on Windows XP. Win2K stores the data using
      NTFS native streams, instead of a thumbs.db file.

     You can extract thumbnails by calling IShellFolder::GetUIObjectOf to obtain an
     IExtractImage interface for each item you're interested in. But unfortunately you don't
     get a free ride on the shell's thumbnail cache.

=-=-=-=-=-=-
Another hit idnicated that the aske found what looked like valid JPG files but missing critical grayscale tables (presumably held internally in the activeX control that uses these proprietary .DB files)

An old MSDN article says that you can use an ActiveX object named ThumbCtrl -- I found it in the VC++ list, but the ClassWizard was not able to create a wrapper for it.
=-=-=-=-=-
some related info:
     Windows Explorer No Longer Displays Web View Templates or
     HTML Customizations (Using Folder.htt)
     http://support.microsoft.com/default.aspx?scid=kb;en-us;819028
The link list at the bottom hase background info and info about ImageExtractors, etc.

Looking at folder.htt, the classID of the Thumbnail object seems to be:
    1D2B4F40-1F10-11D1-9E88-00C04FDCAB92

=--==-=-=-=-=-=-=-=-=-
Another thread said to try SHGetFileInfo, but that did not get the thumbnail when I tried it various ways.

-- Dan
0
 
LVL 49

Accepted Solution

by:
DanRollins earned 400 total points
ID: 9946601
http://www.vbaccelerator.com/home/VB/Type_Libraries/IVBExtractImage/article.asp&e=7249

Shows a VB tool to extract a thumbnail using the IExtractImage interface.  I can't tell if this can use thumbs.db as a cache of some sort.

   IExtractImage Interface
   http://msdn.microsoft.com/library/en-us/shellcc/platform/shell/reference/ifaces/iextractimage/iextractimage.asp

See "Extracting thumbnail previews" here:
         http://netez.com/2xExplorer/shellFAQ/bas_infos.html
It looks like maybe enough C++ code to get started.

=-=-=-=-=-=-
If you Use the VC++ ClassWizard to "Add from TypeLib..." and browse to WebVw.DLL, you can get wrappers for interfaces such as IExtractImage.  But I can't find a clean example of using them.

-- Dan
0
 
LVL 1

Author Comment

by:TiCpu
ID: 9947384
Thanks for answer, so there aren't any valid ways to extract them directly from thumbs.db, it is only possible to create them from original document.. I let this question open 1 or 2 more days to be sure, if it isn't possible at all, DanRollins will have the points.
0
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 1

Author Comment

by:TiCpu
ID: 9958677
I'll do with that, on Google groups there are some starts in thumbs.db decoding.

Thanks for infos!
0
 

Expert Comment

by:kipher
ID: 10986983
Thumbs.db is a OLE Storage object. It follows a OLE storage specification to store jpegs in a RGB format however it misses some information, so extracting individual jpegs would not solve the problem cause there is no viewer that can understand this format.
So the only way i found to view the thumbs without having the originals is to "trick" Windows, so that it "thinks" that there is no need to refresh thumbs.db when you open a dir.
Once I programmed a perl script that could do this. It read the names and number of files (this information is at the CATALOG block of the OLE) in thumbs.db and create template files in a chosen dir. So Windows create thumbs.db of this dir. And so the perl script copies the jpegs codes from the original thumbs.db to the newly created. When you open that dir again Windows thinks theres no need to refresh and show you the thumbs you wanna see instead of the template thumbs. Got it?
0
 

Expert Comment

by:Pendanmagdiaspa
ID: 21189359
This app will display the images in a bare Thumbs.db file, i.e. in the absence of the original images:
   http://www.itsamples.com/software/tdv.html
However, it does not provide for extracting the thumbnails into individual files. Still, all you need is the app and a Thumbs.db file (perhaps copied over the network) to see the images (it worked fine on a couple of smaller sized Thumbs.db files, ~70 & ~700 K, but crashed on a larger one, ~7000 K).
0
 
LVL 2

Expert Comment

by:Castorix
ID: 23752609
> so there aren't any valid ways to extract them directly from thumbs.db

Of course there is, simply with StgOpenStorage(), ::OpenStream(), etc.
Classic code (C)
0
 

Expert Comment

by:bimminger
ID: 24675216
I am also looking for how to read the thumbs out of thumb.db, but with another difficulty: I am using Java in my project; and the C# classes to read the OLE file format are not available for Java...

What I found is C# source code how to read the thumbnails from thumbs.db - this may help you (In the sourcecode section, full C# source is available):

http://www.itsamples.com/software/tdv.html
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

This article shows how to make a Windows 7 gadget that extends its U/I with a flyout panel -- a window that pops out next to the gadget.  The example gadget shows several additional techniques:  How to automatically resize a gadget or flyout panel t…
Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now