Return to Digital Photography Articles
What are THM files?
THM files are THuMbnails that are automatically generated alongside certain larger photo and video file types, such as Canon's RAW (.CRW) and movies (.AVI). The THM file format is essentially identical to the JPEG File Format (JFIF) -- in fact, renaming a suitable (i.e. small) .JPG image file to .THM effectively creates a THM thumbnail. Similarly, renaming a *.THM file to *.JPG will allow you to double-click and open in a photo viewer.
In addition to the compressed image data, a JPEG file contains a series of markers that carry useful metadata -- details about how the photo was taken, camera settings, etc. While most of this metadata is written by the camera itself, some items are done by the user by a catalog / photo browser program. These details include titles, descriptions, keywords and many other fields (even GPS coordinates!).
The specification of the JPEG (or THM) file format is openly published, and so inserting in additional metadata into a file is generally no problem. Unfortunately RAW file formats (e.g. .CRW or .CR2 in the case of Canon) are proprietary and not published. Therefore, it is very difficult (or risky) for a third-party program to make modifications to these files, such as the addition of metadata content.
Since Canon (and other manufacturers) realize that a) they want to keep their RAW format secret and b) they must allow some means for people to annotate the metadata, the solution is to create a "buddy file" mechanism. THM files are the buddy-files associated with Canon RAW files.
A .THM file is simply a small JPEG preview image that is used to house all of the writeable metadata content that would otherwise be written into the associated RAW file. The THM and RAW file must have exactly the same name, and any file operation (copy, move, delete) must be done to both in order to maintain the link.
Therefore, you might find a 20061015_1234.CRW along with a 20061015_1234.THM file in your image directory.
Why do you need to write metadata?
Ideally, you would have a writeable metadata format associated with all images in your database. This allows you to associate metadata (e.g. IPTC) with each image.
Advantages of being able to write the metadata:
- Allows rebuild of catalog database categories should the database get corrupted
- Allows export to another catalog program
RAW files require a buddy .THM file to accomplish this update with third-party utilities.
Can I delete THM files?
While these THM files might appear to clutter up your image directories, try to avoid the temptation in deleting them! Eventually, you may run into problems when managing the RAW files within a digital asset management program (photo catalog database), where you may want to associate additional metadata with the images.
If you did delete them, then please check out the article: recreating THM files from RAW.
Unfortunately, it's easy to accidentally delete these .THM files when you are working in an environment that isn't buddy-file aware (such as Windows XP). Most aware environments will perform the same operation on the original and associated buddy file (rename, copy, delete). Doing this outside such an editor can cause the association to become broken.
I discovered that a number of my older RAW files were missing the associated THM file, which was immediately flagged by catalog program as soon as I tried to open up an IPTC editor window.
13 users online

Reader's Comments:
Please leave your comments or suggestions below!files . how do i change them so i can see them ? they are of my child playing Basketball..we run windows xp? please help
< -- Comment from 2007-07-30 Regarding Canon IXUS 75 -- >
Once you have found one, encode with the following parameters (which will match the Canon IXUS 75 / SD750 AVI settings):
Name the output file: MVI_####.AVI where #### is a number between 0000 and 9999 (eg. MVI_1000.AVI).
To ensure that you've done the encoding correctly, you can open the generated .AVI file in JPEGsnoop and confirm that the Video FourCC code is in fact MotionJPEG.
Once you have generated the .AVI file, we just need to create a suitable .THM file. Another poster has suggested that the camera doesn't actually use the JPEG image stored within the thumbnail file, so a quick solution may be to do the following:
- Encode your video and produce a .AVI file (e.g. MVI_1000.AVI)
- Copy a .THM file from another video produced by your digicam (e.g. MVI_0064.THM) and rename it to match the same initial filename as your encoded video (e.g. MVI_1000.THM).
- Copy both files (e.g. MVI_1000.AVI and MVI_1000.THM) onto your memory card.
- View the contents of the memory card with your digicam in Playback mode
Let me know if this works. I will have a look for suitable converters on the web to do the encoding part, and once I find a good one I'll create a page here that shows you how to do the steps in more detail. If you do manage to locate a converter (e.g. with a free trial) and complete the steps above, please let me know -- and I'll help you get it working if there are any troubles.how can i play it on my Laptop
Thanks
Raj kamal
You should be able to confirm this by opening up a video taken by your Sony digicam in JPEGsnoop. It will probably say that it detects a MotionJPEG AVI file. Then, try opening up the AVI file that you are trying to load into your digicam, and you'll probably see a FourCC code other than MJPG (Motion JPEG).
I've also copied the thm of one clip made with the cam over another also made with the cam and it works, it actually shows the first frame of the video rather then the wrong image from the thm file. So it looks like we can reuse thm's from different videos. I just haven't figured out how to get it to accept the encoding. Perhaps there is some subtle setting in the encoder? There are many options, perhaps too many to try them all...
As for the video encoding, the camera is going to be very picky. Without having a detailed comparison analysis of the .avi files, it would be hard to discern what you may still be missing in the encode.
That said, I have actually been working on enhancing JPEGsnoop to read MotionJPEG videos, which will allow you to accomplish this exact analysis! If you can leave me a message, I'll help you get your media player working
I would appreciate any help with this.
It would be hard to guess at why the video files were deleted in the first place, so I can't recommend any real way to avoid this problem. Nonetheless, I would suggest that you consider backing up all your photos & videos immediately after doing your first pass at deleting the obvious bad shots (with more than one hard drive, it's pretty easy to set this up to be done automatically). This way, you can hopefully recover from accidents like this in the future. Hopefully you didn't lose any important video clips.
So, if you are copying a AVI file that was recorded by the same camera previously, then it may work after copying the AVI file to the memory card. Trying to use a different AVI file will probably mean needing to convert the type of AVI file (to MotionJPEG and the proper resolution).
I have not tried this yet, but I might investigate to see how easy or difficult it is to do this and report back here.
NOTE: I am out of the country for several months (in India), so comments will be held and only posted infrequently. Thanks!