Sensor temperature?


Lots of DSLRs have temperature sensors, which is different from "color temperature". The latter is the only temperature-related parameter that I can find in the documentation. Is the sensor temperature also readable with Libraw? Where/how?



There is no special data

There is no special data field/parsing code for this data in libraw.

For cameras with temperature data stored in EXIF fields (panasonic/leica, for example) you may install own EXIF parser callback to get this data.

-- Alex Tutubalin

I didn't know about such

I didn't know about such tools to get EXIF info programmatically, apart from what Libraw does. Can you recommend one in either C or C++?


Thanks, I will have a look,

Thanks, I will have a look, this could solve my problem for now. Nonetheless it would be ideal to have this information from within Libraw. In the context of astrophotography, DSLRs get modified sometimes with an inconvenient external display linked to another inner temperature sensor (with extra cost) whereas this information could easily be displayed for monitoring temperature evolution of the electronics by using the existing sensor that throws this information in the raw file or exif data. This would make the management of dark files much sensible and easier. Indeed, sometimes we take a shot at the same temperature as some other night, for which we already have a dark file, or, knowing the two different temperature of two different dark files, we can interpolate a new dark file at the missing temperature, or we just want to characterise the temperature dependance of the noise. It's just a suggestion, but it would be a very nice feature for a future update, it will spare the trouble of adding yet another library to get this extra bit of information.

When adding additional

When adding additional metadata parse to libraw we need to support most major camera vendors (C,F,L,N,O,P,P,S,S). Unfortunately vendor specific metadata (makernotes) is not documented and may change in format from camera to camera (even from one firmware version to another).

So we support only metadata that is absolutely necessary for common photographic processing.

For your needs you may also use call to external exiftool program and parse output (command line like exiftool -cameratemperature -csv _81E0220.CR2 ). It is easy to implement and exiftool license is free to do that.

-- Alex Tutubalin

Ok, I understand that it

Ok, I understand that it would cumbersome to maintain such feature. I will give it a try to either exiv2 or exiftool. The problem with using a command line output is that it would make me digress a bit from my software intended design. So far I manage to have things work in Windows, Mac and Linux without any hassle but dealing with exiftool command line will break things out of my software, and maybe forcing the user to install exiftool too?...
exiv2 seems to allow to keep things more internal.

You use Qt library. It is

You use Qt library. It is very easy to use QProcess wrapper to run exiftool (make sure you've closed raw file handle in Windows to allow access, LibRaw::recycle_datastream() do that, keeping all parsed data in memory).

We supply exiftool binary with our RawDigger software, exiftool's license permits this.

-- Alex Tutubalin

Great! If I can provide the

Great! If I can provide the binary, it's fine then. I never used QProcess, but I'll find out. Thanks Alex!

Camera temperature from makernote

I got some more information on this through the Exiftool documentation, as Exiv2 does not yet support this parameter (under discussion with the Exiv2's author). ideally I would like to avoid using Perl-based Exiftool.

Going first here: (with explanation on how to decypher what follows)
and clicking on Canon, you end up with the tag list, with adresses written in hex.
Then at 0x0004, clicking on “Canon ShotInfo Tags” brings you down to a so called 2-byte-offseted “index2” at number 12 (and I have no idea what that means), where you’ll find the little bugger “CameraTemperature”.

With this information, I have to find out how to read that out either from the raw file, getting my hands dirty, or through the Exiv2 API, if it allows it knowing the exact locations in the makernote...
Feel free to advise, although i understand this not Libraw's concern.

Canon Makernotes is, sure,

Canon Makernotes is, sure, array of binary data pointed by 0x927c EXIF tag.

The problem with Canon is camera specific makernotes, so you'll need to process every variant
(Canon CameraInfo1D Tags, Canon CameraInfo1DmkII Tags, etc, etc,etc)

For different vendors you'll need to add more vendors processing.

Exiftool already do this camera/vendor specific processing.

-- Alex Tutubalin