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.
Reader's Comments:
Please leave your comments or suggestions below!What the heck do I do?!
"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."
I completed the steps above, the THM file I copied (which was originally created by the camera itself) was renamed as per the AVI file I wished to play (conforming to the canon convention).
When I scrolled in camera to the newly copied file, it showed the correct filename, but a smaller version of the original THM thumnbail! It didn't show the option to play it, although recognised it as an AVI file. That would make sense. This camera
obviously does compare the THM file with the AVI file.
So - how to create a new THM file from an existing AVI file?
Thanks!!
The question relating to how best to copy an avi fail to a canon camera, and allow it to play on it - did people ever respond with their findings?
thanks!
>Joe
It shows that I have now got 68 THM files from various dates so I can locate their associated videos but it's not exactly a quick matter as they are all in different folders.
I'm confused as to why the THM files didn't
a) rename with their video files and
b) move with them as it seems to only be recent videos that are here and I've certainly moved past videos which haven't left a THM file behind.
- Do you know any quick way in Bridge to link them back to their partners?
- Is there a setting I need to change to ensure that future videos will automatically rename and move with their partners?
Thank you so much for providing this kind of information.
Glenn
If I don't want or need the meta data, trash the THM, or if I shoot while capturing both a .jpg and raw image, I have a link back to THM information without having to save the THM file. Correct?
Also, the longer term problem, after about 10k photos, i think, my camera starts over at image 0001. What are the implications when I have two images raw with the same name, resolution, etc, yet taken years apart. How does my folder full of images recognize these are two different images?
If I have a photo, I generally leave it in a folder related to the date, or I may use iPhoto. If iPhoto, and a raw file, I think I am danger of overwriting the file of the same name. The .jpg file seems to protect me to some degree, as the meta data is distinct. I feel that I am going to overwhelm iPhoto quickly, any other suggestions for a browsable library that can handle 20,000 plus images? As live goes on, my images continue to grow in quantity.
Also, for clarity, seems many missed the idea that a file.thm can be changed to file.jpg by simply changing the last 3 letters. That was interesting. Thanks for all your great information.
Pitty that AVI's don't save meta data within, if I understood correctly. Do MP4, or .MOV files store meta data? Having that little extra file to track, and move with everything could become quite tedious without the right strategy.
I accidentally deleted the *.thm files associated with *.mov files of my Canon IXUS 100IS. Can I read them anyway? I can't read them...
Help me, please...
Thank you very much...
THEN, AFTER reading the instruction manual I had to print, it has that you should use the program that came on the solution disk - which I did and now by using Zoom EX Browser, but will NOT play on Windows Media Player.
I can play the original videos I downloaded without using the camera's software on my husband's computer - everything is fine - but not on mine.
I hope this will upload to YouTube....we'll see.
I don't know if this info. will help anyone, but I've had similar problems with my new CanonPowerShot SX10IS - which saves the video as a MOV file type and only allows you to view the video with the CD that came with the camera, so I couldn't use Windows Media. After 2 long nights of goggling, reading lots of into and being totally frustrated that I wouldn't be able to use any of my video's in Windows Movie Maker - I finally found a solution. First, I downloaded QuickTime7 from> www.apple.com It's FREE & somehow became the defalut to all my MOV files. They do offer a Full-version for a purchase price but after reading all of the negative comments on the product, it wasn't worth it. With QuickTime7, I was then able to view my videos but still couldn't use Window's movie maker. Then I goggled MOV to AVI Converter and found > www.aone-video.com It does offer a FreeTrial which will convert several different file types into AVI and WMV & a host of other types. [the FreeTrial only converts half of the video - I know, what's the point of that but it gives you the chance to see the quality & speed of the conversion and it's very good in my opinion] The converter is super easy to use, allows you to upload several video's at once for conversion, control the quality of the video, change settings and size and so on. It does cost $25.00 but is well worth it, given the dozen or so other programs that I checked out. I tried to find a FREE CONVERTER but in goggling FREE, it means a FreeTrial, as I found out the hard way & many of the others programs were complicated and confusing to try and figure out, having tons more info and more features, such as Movie editing and so on. After reading all the comments posted here, it seems that people are looking for a simple solution to the simple problem of being able to view their video's. I hope this helps some of you.....take care PS. After converting your files to WMV, you should be able to still play your videos - and delete those THM files. I tried it and video's played back just fine.
Im also having the same problem ! it would be better if u can show as a example of how to change THM file to a AVI file ....... can I Rename the thm and type avi in it ? and you have mentioned that there should be a thm file and a avi file in the computer ! . i found the thm file but couldnt find the avi file plz help i too got a sony digi cam !
thx
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:
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
sorry to bother you, but there must be some explanation.
if you'd rather communicate via email, you have my address. i'd really appreciate your help.
thanks
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.