ExifTool Forum

ExifTool => Bug Reports / Feature Requests => Topic started by: atharjavaid on June 20, 2022, 07:50:37 AM

Title: How to read binary "thermal data" tag
Post by: atharjavaid on June 20, 2022, 07:50:37 AM
I am new with exiftool. I have thermal image which does not have '-rawthermalimage', instead it has 'Thermal Data'. I am facing problem to read the the binary data associated with this tag. Here the image and the metadata is attached.
Title: Re: How to read binary "thermal data" tag
Post by: StarGeek on June 20, 2022, 10:50:31 AM
The file you uploaded has a RawThermalImage
C:\>exiftool -G -a -s -*Thermal* Y:\!temp\ccc\DJI_0379_T.jpg
[FLIR]          RawThermalImageWidth            : 320
[FLIR]          RawThermalImageHeight           : 240
[FLIR]          RawThermalImageType             : TIFF
[FLIR]          RawThermalImage                 : (Binary data 153804 bytes, use -b option to extract)


It's also not the one in your exiftool output, as the files sizes don't match (1008 kB vs 214 kB).
Title: Re: How to read binary "thermal data" tag
Post by: Hubert on June 20, 2022, 05:33:15 PM
Quote from: StarGeek on June 20, 2022, 10:50:31 AM
the files sizes don't match

Nor do the file names...
Title: Re: How to read binary "thermal data" tag
Post by: atharjavaid on June 21, 2022, 12:16:32 AM
Sorry, Here are the said files, exiftool version 12.42, windows 11 HOME
Title: Re: How to read binary "thermal data" tag
Post by: atharjavaid on June 21, 2022, 12:36:19 AM
Thanks for the response, here is the output i get with the real files

exiftool -G -a -s -*Thermal* DJI_0397_T.jpg
[APP3]          ThermalData                     : (Binary data 655360 bytes, use -b option to extract)
[APP5]          ThermalCalibration              : (Binary data 23818 bytes, use -b option to extract)

are the tags I want their binary data to read and convert to temperature.
Title: Re: How to read binary "thermal data" tag
Post by: Phil Harvey on June 21, 2022, 09:10:16 AM
There are easier ways to do this, but here is a cool way to extract both at the same time:

exiftool -thermaldata -thermalcalibration -b -W %d%f-%t.dat FILE

For the file you posted, I get this:

> exiftool -thermaldata -thermalcalibration -b -W %d%f-%t.dat tmp/DJI_MAVIC2-ENTERPRISE-ADVANCED.jpg
    2 output files created
> ls -l tmp
total 3304
-rw-r--r--  1 phil  staff    23818 21 Jun 09:11 DJI_MAVIC2-ENTERPRISE-ADVANCED-ThermalCalibration.dat
-rw-r--r--  1 phil  staff   655360 21 Jun 09:11 DJI_MAVIC2-ENTERPRISE-ADVANCED-ThermalData.dat
-rwxr-xr-x@ 1 phil  staff  1008283 21 Jun 09:08 DJI_MAVIC2-ENTERPRISE-ADVANCED.jpg


- Phil
Title: Re: How to read binary "thermal data" tag
Post by: atharjavaid on June 22, 2022, 04:34:15 AM
wao, that is really great. However, the output is a .dat file with a lot of strange characters.

I want to get temperature. Can some one help to get it out of the extracted .dat files? Here are the two extracted files attached. 
Title: Re: How to read binary "thermal data" tag
Post by: StarGeek on June 22, 2022, 05:38:19 AM
The best that can be offered would probably be this thread (https://exiftool.org/forum/index.php?topic=11401.0).