Phil Harvey recently published Exiftool 7.97, which comes with a well hidden, but exciting feature: it can decode the camera temperature for Canon PowerShot Models. All Canon Powershots built 2005 or later store this information in their EXIF header, albeit in a proprietary, previously unknown format. According to Phil, the camera temperature corresponds more or less to the external temperature, if the device was exposed for a certain time to an environment. This opens interesting possibilities for image searches: you can quickly filter out pictures taken on a hot beach or during a snowball fight in winter. This article shows you how to access the camera temperature and explores the possibilities of thermo tagging.

UPDATE:Also quite a few Canon IXUS and EOS models as well as many Pentax cams seem to write this tag.

filtering the temperature of your photos

Hot or cold? - The CameraTemperature tag recorded by Canon Powershot cameras allows you to conduct temperature-based searches.

Footage (c) Flickr users Orangesmell and Aduki

Got footage?

If you don’t own a PowerShot, you can quickly download the necessary footage: Phil Harvey hosts a huge “Meta Information Repository”, that contains sample images from many camera manufacturers, including Canon. Simply download the Canon Archive and extract it to your hard disk. Note: to save bandwith, the actual image has been replaced by a tiny placeholder, but the original metadata is still in place. This is fully sufficient for our experiments.

As I don’t own a PowerShot by myself, I also made use of the footage in the repository. If you are a PowerShot user and want to create footage by yourself, be warned: don’t expose your camera to extreme temperatures as this might rapidly shorten its life expectancy.

Extracting the Camera Temperature

First make sure that you ‘ve installed Exiftool 7.97 or newer on your system. When in doubt, simply run

exiftool -ver

from your shell or command prompt – this command displays exiftool’s version number. Then navigate to a folder containing unmodified photos taken by a Canon Powershot camera and run

exiftool -CameraTemperature -ext JPG .

and you should get a list like

Camera Temperature : 23 C
======== CanonPowerShotSD890IS.jpg
Camera Temperature : 26 C
======== CanonPowerShotSD900.jpg
Camera Temperature : 25 C
======== CanonPowerShotSD950IS.jpg
Camera Temperature : 30 C

Exiftool lists the camera temperature in degrees celsius. The -ext JPG . part of the command line makes exiftool look for all JPG files in the current directory, no matter if the extension is upper- or lowercase. By appending -r you can expand the search to subdirectories.

Filtering by temperature

With a bit of command-line-magic, you can also filter your photos by temperature:

exiftool -cameratemperature -if '$cameratemperature# < 20' -ext JPG .

will list all photos that were taken at a camera temperature below 20 degrees celsius, whereas

exiftool -cameratemperature -if '$cameratemperature# >= 20' -ext JPG .

displays a list of all photos taken at 20 degrees or more.

These two filtering commands deserve some explanation: the -if parameter tells exiftool to process only files that meet a certain condition. Also the inner part of the if clause is a bit special: '$cameratemperature# < 20' consists of the tag name cameratemperature (the prepended $ is needed to identify a tagname within a string). The appended # tells exiftool to convert the tag value to a number (e.g. 19 instead of '19 C'). The rest of the clause is quite easy: '< 20' stands for "all values smaller than 20", while >=20 means “greater or equal to 20″.

ThermoTagging hot or cool photos

As exiftool “decodes a riddle wrapped in a mystery inside an enigma” (quote Phil Harvey), it can extract such esoteric tags like Canon:CameraTemperature that are buried in the depths of propriertary Makernotes. Most (if not all) other Metadata readers and image management applications fail decoding this information. So it would be nice to convert the camera temperature to a format that all other applications can access. The most common way to do so is to create an IPTC Keyword for the information contained in the tag. IPTC Keywords are read by most image editors including Photoshop, many photosharing services (including flickr and picasa) auto-convert them to tags during photo upload.
Converted Thermotags at flickr.com
Converted Thermotags at flickr.com

Storing descriptive tags

exiftool -keywords+=cold -if '$cameratemperature# < 15' -ext JPG .

adds the IPTC keyword "cold" to your photo, if the camera temperature was less than 15 degrees. Just modify keyword and if-clause to tag "hot" photos ;-)
To test your results, you can use


exiftool -keywords -cameratemperature -if '$keywords eq "cool"' *.jpg
======== CanonEOS_KissX2.jpg
Keywords : cool
Camera Temperature : 18 C
======== CanonIXY_DIGITAL20IS.jpg
Keywords : cool
Camera Temperature : 17 C
[...]

This commands lists all photos with the keyword “cold” and extracts their keywords and Camera Temperature.

Storing precise values

If you want to store the precise degree value, you can use:

exiftool '-cameratemperature+>keywords' *.jpg

which copies the Camera Temperature value directly to an IPTC Keyword:

exiftool -keywords CanonPowerShotSX200IS.jpg
Keywords : cool, 18 C

Is the camera temperature really identical with the outside temperature?

Although I don’t own a Canon Powershot, I wanted to verify Phil’s assumptions on Canon’s CameraTemperature. In short, he claims that the CameraTemperature is close to the outside temperature, if the device was left in an environment for a certain time. According to him, taking a lot of images in a short time additionally heats up the camera by some degrees. While my tests can’t prove the equality of the temperatures, they indicate a strong correlation (maybe with some offset factor):

  • Range of the CameraTemperature exiftool dumped out values between 12 and 39 degrees celsius for Phil’s sample images. This indicates that the camera temperature is maybe a bit above the outside temperature (why are there no pics with values less than 10 degrees?)
  • Correlation of creation date and CameraTemperature When I compared the temperature with the creation date (Exif:DateTimeOriginal), it turned out that all photos with value less than 20 degrees were taken in autumn or winter
  • Visual correlation I extracted a few thumbnails from the “hottest” (> 35) degrees and coldest (< 15 degrees) values) and tried to find visual hints for heat or coldness (e.g. snow, summer clothes etc). My verdict is that there are no contradictory elements, but you can judge for yourself by looking at the hottest or the coldest thumbnails.

Acknowledgements
I want to thank Phil Harvey for developing Exiftool and his suggestions on this article. Vesa Kivisto also deserves a honorary mention for the decoding of the CameraTemperature tag.