Minor Bug: Flir PlanckO

Started by tomas123, February 10, 2015, 08:43:05 AM

Previous topic - Next topic

tomas123

Hi Phil,

there is a minor bug in Flir tag Planck0

Flir.pm
  441     0x308 => { Name => 'PlanckO',           Format => 'int16s' }, #1

The  Planck0 value is 4 Byte, but in the most cameras with reversed byte order we don't notice it.

https://exiftool.org/sample_images.html

in the images from your sample gallery some Planck0 values are -1
D:\tmp\flir\FLIR_sample>exiftool -PlanckO *.jpg
======== FLIR_AX5.jpg
Planck O                        : -283
======== FLIR_B20HS.jpg
Planck O                        : -4096
======== FLIR_B335.jpg
Planck O                        : -6029
======== FLIR_b40.jpg
Planck O                        : -4360
======== FLIR_b50.jpg
Planck O                        : -4422
======== FLIR_Bertha3.jpg
Planck O                        : -6609
======== FLIR_E30.jpg
Planck O                        : -6240
======== FLIR_E30bx.jpg
Planck O                        : -6159
======== FLIR_E4.jpg
Planck O                        : -7302
======== FLIR_E40.jpg
Planck O                        : -5859
======== FLIR_E40bx.jpg
Planck O                        : -6181
======== FLIR_E5.jpg
Planck O                        : -7322
======== FLIR_E50.jpg
Planck O                        : -6233
======== FLIR_E6.jpg
Planck O                        : -8056
======== FLIR_E60.jpg
Planck O                        : -6233
======== FLIR_E8.jpg
Planck O                        : -7877
======== FLIR_i3.jpg
Planck O                        : -6635
======== FLIR_i5.jpg
Planck O                        : -6878
======== FLIR_i50.jpg
Planck O                        : -4468
======== FLIR_i60.jpg
Planck O                        : -4841
======== FLIR_i7.jpg
Planck O                        : -6646
======== FLIR_P20NTSC.jpg
Planck O                        : -1
======== FLIR_P25PAL.jpg
Planck O                        : -4096
======== FLIR_P60.jpg
Planck O                        : -4096
======== FLIR_P60NTSC.jpg
Planck O                        : -4096
======== FLIR_P60PAL.jpg
Planck O                        : -4096
======== FLIR_P640.jpg
Planck O                        : -7012
======== FLIR_P660.jpg
Planck O                        : -6874
======== FLIR_S65NTSC.jpg
Planck O                        : -1
======== FLIR_T250_Western.jpg
Planck O                        : -5202
======== FLIR_T360_Western.jpg
Planck O                        : -5125
======== FLIR_T400.jpg
Planck O                        : -6040
======== FLIR_T400Western.jpg
Planck O                        : -5338
======== FLIR_T425.jpg
Planck O                        : -6255
======== FLIR_T620.jpg
Planck O                        : -5425
======== FLIR_T620bx.jpg
Planck O                        : -4394
======== FLIR_T640.jpg
Planck O                        : -5804
======== FLIR_ThermaCAM_A320.jpg
======== FLIR_ThermaCAM_B-360Wes.jpg
Planck O                        : -4830
======== FLIR_ThermaCAM_E2.jpg
Planck O                        : -4096
======== FLIR_ThermaCAM_E320.jpg
Planck O                        : -4096
======== FLIR_ThermaCAM_E65.jpg
Planck O                        : -1
======== FLIR_ThermaCAM_EX320.jpg
Planck O                        : -1
======== FLIR_ThermaCAM_P640.jpg
Planck O                        : -7677
======== FLIR_ThermaCAM_P660West.jpg
Planck O                        : -6497
======== FLIR_ThermaCAM_SC640.jpg
Planck O                        : -7916
======== FLIR_ThermaCAM_SC660Wes.jpg
Planck O                        : -6009
======== FLIR_ThermaCAM_T-400.jpg
Planck O                        : -4836
======== FLIR_ThermaCamP660Wes.jpg
Planck O                        : -6169
======== FLIR_ThermaCamSC660WES.jpg
Planck O                        : -6641
======== FLIR_Z-Camera.jpg
Planck O                        : -6743
   51 image files read



but with this config file
# The %Image::ExifTool::UserDefined hash defines new tags to be added to existing tables.
%Image::ExifTool::UserDefined = (
    'Image::ExifTool::FLIR::CameraInfo' => {
          0x308 => { Name => 'PlanckO', Format => 'int32s'},
    },
);


all works fine  :)

>exiftool -config config.txt -PlanckO *.jpg
======== FLIR_AX5.jpg
Planck O                        : -283
======== FLIR_B20HS.jpg
Planck O                        : -4096
======== FLIR_B335.jpg
Planck O                        : -6029
======== FLIR_b40.jpg
Planck O                        : -4360
======== FLIR_b50.jpg
Planck O                        : -4422
======== FLIR_Bertha3.jpg
Planck O                        : -6609
======== FLIR_E30.jpg
Planck O                        : -6240
======== FLIR_E30bx.jpg
Planck O                        : -6159
======== FLIR_E4.jpg
Planck O                        : -7302
======== FLIR_E40.jpg
Planck O                        : -5859
======== FLIR_E40bx.jpg
Planck O                        : -6181
======== FLIR_E5.jpg
Planck O                        : -7322
======== FLIR_E50.jpg
Planck O                        : -6233
======== FLIR_E6.jpg
Planck O                        : -8056
======== FLIR_E60.jpg
Planck O                        : -6233
======== FLIR_E8.jpg
Planck O                        : -7877
======== FLIR_i3.jpg
Planck O                        : -6635
======== FLIR_i5.jpg
Planck O                        : -6878
======== FLIR_i50.jpg
Planck O                        : -4468
======== FLIR_i60.jpg
Planck O                        : -4841
======== FLIR_i7.jpg
Planck O                        : -6646
======== FLIR_P20NTSC.jpg
Planck O                        : -4096
======== FLIR_P25PAL.jpg
Planck O                        : -4096
======== FLIR_P60.jpg
Planck O                        : -4096
======== FLIR_P60NTSC.jpg
Planck O                        : -4096
======== FLIR_P60PAL.jpg
Planck O                        : -4096
======== FLIR_P640.jpg
Planck O                        : -7012
======== FLIR_P660.jpg
Planck O                        : -6874
======== FLIR_S65NTSC.jpg
Planck O                        : -4096
======== FLIR_T250_Western.jpg
Planck O                        : -5202
======== FLIR_T360_Western.jpg
Planck O                        : -5125
======== FLIR_T400.jpg
Planck O                        : -6040
======== FLIR_T400Western.jpg
Planck O                        : -5338
======== FLIR_T425.jpg
Planck O                        : -6255
======== FLIR_T620.jpg
Planck O                        : -5425
======== FLIR_T620bx.jpg
Planck O                        : -4394
======== FLIR_T640.jpg
Planck O                        : -5804
======== FLIR_ThermaCAM_A320.jpg
======== FLIR_ThermaCAM_B-360Wes.jpg
Planck O                        : -4830
======== FLIR_ThermaCAM_E2.jpg
Planck O                        : -4096
======== FLIR_ThermaCAM_E320.jpg
Planck O                        : -4096
======== FLIR_ThermaCAM_E65.jpg
Planck O                        : -4096
======== FLIR_ThermaCAM_EX320.jpg
Planck O                        : -4096
======== FLIR_ThermaCAM_P640.jpg
Planck O                        : -7677
======== FLIR_ThermaCAM_P660West.jpg
Planck O                        : -6497
======== FLIR_ThermaCAM_SC640.jpg
Planck O                        : -7916
======== FLIR_ThermaCAM_SC660Wes.jpg
Planck O                        : -6009
======== FLIR_ThermaCAM_T-400.jpg
Planck O                        : -4836
======== FLIR_ThermaCamP660Wes.jpg
Planck O                        : -6169
======== FLIR_ThermaCamSC660WES.jpg
Planck O                        : -6641
======== FLIR_Z-Camera.jpg
Planck O                        : -6743
   51 image files read




some details:

Quote>exiftool -v4 FLIR_ThermaCAM_E320.jpg | grep -A 20 -B 200 -i PlanckO
...
  | | FLIR Record 0x20, offset 0x14678, length 0x047c
  | | 1)  CameraInfo (SubDirectory) -->
  | |     - Tag 0x0020 (1148 bytes):
  | |        14678: 02 00 40 01 f0 00 00 00 00 00 00 00 3f 01 00 00 [..@.........?...]
  | |        14688: ef 00 0f 00 0c 00 00 00 00 00 03 00 00 00 00 00 [................]
...
  | |        14968: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [................]
  | |        14978: 00 00 00 00 00 00 00 00 00 f0 ff ff b7 0e c3 3c [...............<]
  | |        14988: 04 00 03 63 00 00 00 00 00 00 00 00 00 00 00 00 [...c............]
...
  | | | PlanckO = -4096
  | | | - Tag 0x0308 (2 bytes, int16s[1]):
  | | |    14980: 00 f0        
                                  [..]

and
Quote>exiftool -v4 FLIR_ThermaCAM_EX320.jpg | grep -A 20 -B 200 -i PlanckO
   | | FLIR Record 0x20, offset 0x12ae4, length 0x047c
  | | 1)  CameraInfo (SubDirectory) -->
  | |     - Tag 0x0020 (1148 bytes):
  | |        12ae4: 00 02 01 40 00 f0 00 00 00 00 00 00 01 3f 00 00 [...@.........?..]
  | |        12af4: 00 ef 00 0f 00 0a 00 00 00 00 00 03 00 00 00 00 [................]
...
  | |        12dd4: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [................]
  | |        12de4: 00 00 00 00 00 00 00 00 ff ff f0 00 3d 21 b3 c9 [............=!..]
  | |        12df4: 00 04 89 d5 00 00 00 00 00 00 00 00 00 00 00 00 [................]
  | |        12e04: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [................]
...
  | | + [BinaryData directory, 1148 bytes]
...
  | | | PlanckO = -1
  | | | - Tag 0x0308 (2 bytes, int16s[1]):
  | | |    12dec: ff ff                                           [..]
  | | | PlanckR2 = 0.0394780971109867

Phil Harvey

#1
Hi Tomas,

Great, thanks for the fix!  This will appear in ExifTool 9.85.

- Phil

Edit:  Fixed typo in your name.  My fingers insist on spelling your name with an "h".
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

tomas123

I got the bug from an eevblog user:
http://www.eevblog.com/forum/testgear/flir-e4-thermal-imaging-camera-teardown/msg342072/#msg342072

I have the impression that I am the only user who reads your source code

millions user and only one developer
:(

Thanks for your great and hard work