~ubuntu-branches/ubuntu/karmic/libimage-exiftool-perl/karmic

« back to all changes in this revision

Viewing changes to lib/Image/ExifTool/CanonCustom.pm

  • Committer: Bazaar Package Importer
  • Author(s): Mari Wang
  • Date: 2008-02-04 20:32:53 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20080204203253-mpbal8trlfe1fz5d
Tags: 7.00-1
* Upload of new production release (Closes: #456430)
* Added Recommends: libcompress-zlib-perl (Closes: #435589)
* Package now includes iptc2xmp.args and xmp2iptc.args, they are put
  into /usr/share/libimage-exiftool/ (Closes: #436100)
* Updated standards-version (3.7.2 -> 3.7.3). No changes needed.
* Lots of updates and bugfixes compared to last debian version
  (6.90).  See the Changes file for details
* Upload sponsored by Petter Reinholdtsen

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
use Image::ExifTool::Canon;
19
19
use Image::ExifTool::Exif;
20
20
 
21
 
$VERSION = '1.14';
 
21
$VERSION = '1.17';
22
22
 
23
23
sub ProcessCanonCustom($$$);
24
24
sub ProcessCanonCustom2($$$);
831
831
        PrintConv => {
832
832
            0 => 'Emits',
833
833
            1 => 'Does not emit',
834
 
            2 => 'Only emits ext. flash',
 
834
            2 => 'Only ext. flash emits',
835
835
        },
836
836
    },
837
837
    5 => {
908
908
        PrintConv => {
909
909
            0 => 'Emits',
910
910
            1 => 'Does not emit',
911
 
            2 => 'Only emits ext. flash',
 
911
            2 => 'Only ext. flash emits',
912
912
        },
913
913
    },
914
914
    5 => {
1177
1177
    24 => 'PF27Value',
1178
1178
);
1179
1179
 
1180
 
 
1181
 
# Custom functions for the 1D Mark III (ref PH)
1182
 
%Image::ExifTool::CanonCustom::Functions1DmkIII = (
 
1180
# Custom functions used by the 1D Mark III and later models (ref PH)
 
1181
%Image::ExifTool::CanonCustom::Functions2 = (
1183
1182
    GROUPS => { 0 => 'MakerNotes', 2 => 'Camera' },
1184
1183
    PROCESS_PROC => \&ProcessCanonCustom2,
1185
1184
    CHECK_PROC => \&Image::ExifTool::Exif::CheckExif,
1186
1185
    WRITE_PROC => \&WriteCanonCustom2,
1187
 
    WRITABLE => 'int32u',
 
1186
    WRITABLE => 'int32s',
1188
1187
    NOTES => q{
1189
 
        The EOS 1D Mark III has 57 custom function tags divided into four main
1190
 
        groups: 1. Exposure (0x0101-0x010f), 2. Image (0x0201-0x0203), Flash
1191
 
        Exposure (0x0304-0x0306) and Display (0x0407-0x0409), 3. Auto Focus
1192
 
        (0x0501-0x050e) and Drive (0x060f-0x0611), and 4. Operation (0x0701-0x070a)
1193
 
        and Others (0x080b-0x0810).
 
1188
        Beginning with the EOS 1D Mark III, Canon finally created a set of custom
 
1189
        function tags which are consistent across models.  The EOS 1D Mark III has
 
1190
        57 custom function tags divided into four main groups: 1. Exposure
 
1191
        (0x0101-0x010f), 2. Image (0x0201-0x0203), Flash Exposure (0x0304-0x0306)
 
1192
        and Display (0x0407-0x0409), 3. Auto Focus (0x0501-0x050e) and Drive
 
1193
        (0x060f-0x0611), and 4. Operation (0x0701-0x070a) and Others
 
1194
        (0x080b-0x0810).  The table below lists tags used by the EOS 1D Mark III, as
 
1195
        well as newer values and tags used by the EOS 40D.  It is expected that
 
1196
        future models will re-use some of these tags (possibly with minor value
 
1197
        changes), as well as defining additional new tags of their own.
1194
1198
    },
1195
1199
    # grouped in 4 groups:
1196
1200
    # 1) Exposure
1197
 
    0x0101 => {
1198
 
        Name => 'ExposureLevelIncrements',
1199
 
        PrintConv => {
1200
 
            0 => '1/3-stop set, 1/3-stop comp.',
1201
 
            1 => '1-stop set, 1/3-stop comp.',
1202
 
            2 => '1/2-stop set, 1/2-stop comp.',
1203
 
        },
1204
 
    },
 
1201
    0x0101 => [
 
1202
        {
 
1203
            Name => 'ExposureLevelIncrements',
 
1204
            Condition => '$$self{CameraModel} =~ /\b40D\b/',
 
1205
            Notes => '40D',
 
1206
            PrintConv => {
 
1207
                0 => '1/3 Stop',
 
1208
                1 => '1/2 Stop',
 
1209
            },
 
1210
        },
 
1211
        {
 
1212
            Name => 'ExposureLevelIncrements',
 
1213
            Notes => '1D Mark III',
 
1214
            PrintConv => {
 
1215
                0 => '1/3-stop set, 1/3-stop comp.',
 
1216
                1 => '1-stop set, 1/3-stop comp.',
 
1217
                2 => '1/2-stop set, 1/2-stop comp.',
 
1218
            },
 
1219
        },
 
1220
    ],
1205
1221
    0x0102 => {
1206
1222
        Name => 'ISOSpeedIncrements',
1207
1223
        PrintConv => {
1209
1225
            1 => '1-stop',
1210
1226
        },
1211
1227
    },
1212
 
    0x0103 => {
1213
 
        Name => 'ISOSpeedRange',
1214
 
        Count => 3,
1215
 
        # (this decoding may not be valid for CR2 images?)
1216
 
        ValueConv => [
1217
 
            undef,
1218
 
            '$val < 1000 ? exp(($val/8-9)*log(2))*100 : 0', # (educated guess)
1219
 
            '$val < 1000 ? exp(($val/8-9)*log(2))*100 : 0', # (educated guess)
1220
 
        ],
1221
 
        ValueConvInv => [
1222
 
            undef,
1223
 
            '$val ? int(8*(log($val/100)/log(2)+9) + 0.5) : 0xffffffff',
1224
 
            '$val ? int(8*(log($val/100)/log(2)+9) + 0.5) : 0xffffffff',
1225
 
        ],
1226
 
        PrintConv => [
1227
 
            \%disableEnable,
1228
 
            'sprintf("Max %.0f",$val)',
1229
 
            'sprintf("Min %.0f",$val)',
1230
 
        ],
1231
 
        PrintConvInv => [
1232
 
            undef,
1233
 
            '$val=~/([\d.]+)/ ? $1 : 0',
1234
 
            '$val=~/([\d.]+)/ ? $1 : 0',
1235
 
        ],
1236
 
    },
 
1228
    0x0103 => [
 
1229
        {
 
1230
            Name => 'ISOExpansion',
 
1231
            Condition => '$$self{CameraModel} =~ /\b40D\b/',
 
1232
            Notes => '40D',
 
1233
            PrintConv => {
 
1234
                0 => 'Off',
 
1235
                1 => 'On',
 
1236
            },
 
1237
        },
 
1238
        {
 
1239
            Name => 'ISOSpeedRange',
 
1240
            Notes => '1D Mark III',
 
1241
            Count => 3,
 
1242
            # (this decoding may not be valid for CR2 images?)
 
1243
            ValueConv => [
 
1244
                undef,
 
1245
                '$val < 1000 ? exp(($val/8-9)*log(2))*100 : 0', # (educated guess)
 
1246
                '$val < 1000 ? exp(($val/8-9)*log(2))*100 : 0', # (educated guess)
 
1247
            ],
 
1248
            ValueConvInv => [
 
1249
                undef,
 
1250
                '$val ? int(8*(log($val/100)/log(2)+9) + 0.5) : 0xffffffff',
 
1251
                '$val ? int(8*(log($val/100)/log(2)+9) + 0.5) : 0xffffffff',
 
1252
            ],
 
1253
            PrintConv => [
 
1254
                \%disableEnable,
 
1255
                'sprintf("Max %.0f",$val)',
 
1256
                'sprintf("Min %.0f",$val)',
 
1257
            ],
 
1258
            PrintConvInv => [
 
1259
                undef,
 
1260
                '$val=~/([\d.]+)/ ? $1 : 0',
 
1261
                '$val=~/([\d.]+)/ ? $1 : 0',
 
1262
            ],
 
1263
        },
 
1264
    ],
1237
1265
    0x0104 => {
1238
1266
        Name => 'AEBAutoCancel',
1239
1267
        PrintConv => \%onOff,
1240
1268
    },
1241
1269
    0x0105 => {
1242
1270
        Name => 'AEBSequence',
 
1271
        Notes => 'value of 2 not used by 40D',
1243
1272
        PrintConv => {
1244
1273
            0 => '0,-,+',
1245
 
            2 => '-,0,+',
1246
 
            3 => '+,0,-',
 
1274
            1 => '-,0,+',
 
1275
            2 => '+,0,-',
1247
1276
        },
1248
1277
    },
1249
1278
    0x0106 => {
1264
1293
    },
1265
1294
    0x0108 => {
1266
1295
        Name => 'SafetyShift',
 
1296
        Notes => 'value of 2 not used by 40D',
1267
1297
        PrintConv => {
1268
1298
            0 => 'Disable',
1269
1299
            1 => 'Enable (Tv/Av)',
1359
1389
            \%disableEnable,
1360
1390
        ],
1361
1391
    },
1362
 
    0x010f => {
1363
 
        Name => 'FlashSyncSpeedAv',
1364
 
        PrintConv => {
1365
 
            0 => 'Auto',
1366
 
            1 => '1/200 Fixed',
1367
 
        },
1368
 
    },
 
1392
    0x010f => [
 
1393
        {
 
1394
            Name => 'FlashSyncSpeedAv',
 
1395
            Condition => '$$self{CameraModel} =~ /\b40D\b/',
 
1396
            Notes => '40D',
 
1397
            PrintConv => {
 
1398
                0 => 'Auto',
 
1399
                1 => '1/250 Fixed',
 
1400
            },
 
1401
        },
 
1402
        {
 
1403
            Name => 'FlashSyncSpeedAv',
 
1404
            Notes => '1D Mark III',
 
1405
            PrintConv => {
 
1406
                0 => 'Auto',
 
1407
                1 => '1/300 Fixed',
 
1408
            },
 
1409
        },
 
1410
    ],
1369
1411
    #### 2a) Image
1370
1412
    0x0201 => {
1371
1413
        Name => 'LongExposureNoiseReduction',
1426
1468
    0x0501 => {
1427
1469
        Name => 'USMLensElectronicMF',
1428
1470
        PrintConv => {
1429
 
            0 => 'Turns on after one-shot AF',
1430
 
            1 => 'Turns off after one-shot AF',
1431
 
            2 => 'Always turned off',
 
1471
            0 => 'Enable after one-shot AF',
 
1472
            1 => 'Disable after one-shot AF',
 
1473
            2 => 'Disable in AF mode',
1432
1474
        },
1433
1475
    },
1434
1476
    0x0502 => {
1435
1477
        Name => 'AIServoTrackingSensitivity',
1436
 
        PrintConv => { # (needs verification)
 
1478
        PrintConv => {
 
1479
           -2 => 'Slow',
 
1480
           -1 => 'Medium Slow',
1437
1481
            0 => 'Standard',
1438
 
            1 => 'Slow',
1439
 
            2 => 'Moderately slow',
1440
 
            3 => 'Moderately fast',
1441
 
            4 => 'Fast',
 
1482
            1 => 'Medium Fast',
 
1483
            2 => 'Fast',
1442
1484
        },
1443
1485
    },
1444
1486
    0x0503 => {
1465
1507
    },
1466
1508
    0x0506 => {
1467
1509
        Name => 'LensAFStopButton',
 
1510
        Notes => 'value of 6 not used by 40D',
1468
1511
        PrintConv => {
1469
1512
            0 => 'AF stop',
1470
1513
            1 => 'AF start',
1471
1514
            2 => 'AE lock',
1472
1515
            3 => 'AF point: M->Auto/Auto->ctr',
1473
1516
            4 => 'One Shot <-> AI servo',
1474
 
            # MORE ENTRIES HERE?
 
1517
            5 => 'IS start',
 
1518
            6 => 'Switch to registered AF point',
1475
1519
        },
1476
1520
    },
1477
1521
    0x0507 => {
1531
1575
    },
1532
1576
    0x050e => {
1533
1577
        Name => 'AFAssistBeam',
 
1578
        Notes => 'value of 2 not used by 1D Mark III',
1534
1579
        PrintConv => {
1535
1580
            0 => 'Emits',
1536
1581
            1 => 'Does not emit',
1537
 
        },
 
1582
            2 => 'Only ext. flash emits',
 
1583
        },
 
1584
    },
 
1585
    0x050f => { # new for 40D
 
1586
        Name => 'AFPointSelectionMethod',
 
1587
        PrintConv => {
 
1588
            0 => 'Normal',
 
1589
            1 => 'Multi-controller direct',
 
1590
            2 => 'Quick Control Dial direct',
 
1591
        },
 
1592
    },
 
1593
    0x0510 => { # new for 40D
 
1594
        Name => 'SuperimposedDisplay',
 
1595
        PrintConv => \%onOff,
 
1596
    },
 
1597
    0x0511 => { # new for 40D
 
1598
        Name => 'AFDuringLiveView',
 
1599
        PrintConv => \%disableEnable,
1538
1600
    },
1539
1601
    #### 3b) Drive
1540
1602
    0x060f => {
1541
1603
        Name => 'MirrorLockup',
 
1604
        Notes => 'value of 2 not used by 40D',
1542
1605
        PrintConv => {
1543
1606
            0 => 'Disable',
1544
1607
            1 => 'Enable',
1594
1657
            2 => 'ISO speed',
1595
1658
        },
1596
1659
    },
1597
 
    0x0704 => {
1598
 
        Name => 'SetButtonWhenShooting',
1599
 
        PrintConv => {
1600
 
            0 => 'Normal (disabled)',
1601
 
            1 => 'White balance',
1602
 
            2 => 'Image size',
1603
 
            3 => 'ISO speed',
1604
 
            4 => 'Picture style',
1605
 
            5 => 'Record func. + media/folder',
1606
 
            6 => 'Menu display',
1607
 
            7 => 'Image playback',
1608
 
        },
1609
 
    },
 
1660
    0x0704 => [
 
1661
        {
 
1662
            Name => 'SetButtonWhenShooting',
 
1663
            Condition => '$$self{CameraModel} =~ /\b40D\b/',
 
1664
            Notes => '40D',
 
1665
            PrintConv => {
 
1666
                0 => 'Normal (disabled)',
 
1667
                1 => 'Image quality',
 
1668
                2 => 'Picture style',
 
1669
                3 => 'Menu display',
 
1670
                4 => 'Image playback',
 
1671
            },
 
1672
        },
 
1673
        {
 
1674
            Name => 'SetButtonWhenShooting',
 
1675
            Notes => '1D Mark III',
 
1676
            PrintConv => {
 
1677
                0 => 'Normal (disabled)',
 
1678
                1 => 'White balance',
 
1679
                2 => 'Image size',
 
1680
                3 => 'ISO speed',
 
1681
                4 => 'Picture style',
 
1682
                5 => 'Record func. + media/folder',
 
1683
                6 => 'Menu display',
 
1684
                7 => 'Image playback',
 
1685
            },
 
1686
        },
 
1687
    ],
1610
1688
    0x0705 => {
1611
1689
        Name => 'ManualTv',
1612
1690
        Description => 'Manual Tv/Av For M',
1648
1726
        },
1649
1727
    },
1650
1728
    #### 4b) Others
1651
 
    0x080b => {
1652
 
        Name => 'FocusingScreen',
1653
 
        PrintConv => {
1654
 
            0 => 'Ec-CIV',
1655
 
            1 => 'Ec-A,B,C,CII,CIII,D,H,I,L',
1656
 
            2 => 'Ec-S',
1657
 
            3 => 'Ec-N,R',
1658
 
        },
1659
 
    },
 
1729
    0x080b => [
 
1730
        {
 
1731
            Name => 'FocusingScreen',
 
1732
            Condition => '$$self{CameraModel} =~ /\b40D\b/',
 
1733
            Notes => '40D',
 
1734
            PrintConv => {
 
1735
                0 => 'Ef-A',
 
1736
                1 => 'Ef-D',
 
1737
                2 => 'Ef-S',
 
1738
            },
 
1739
        },
 
1740
        {
 
1741
            Name => 'FocusingScreen',
 
1742
            Notes => '1D Mark III',
 
1743
            PrintConv => {
 
1744
                0 => 'Ec-CIV',
 
1745
                1 => 'Ec-A,B,C,CII,CIII,D,H,I,L',
 
1746
                2 => 'Ec-S',
 
1747
                3 => 'Ec-N,R',
 
1748
            },
 
1749
        },
 
1750
    ],
1660
1751
    0x080c => {
1661
1752
        Name => 'TimerLength',
1662
1753
        Count => 4,
1768
1859
            $num = Get32u($dataPt, $recPos + 4);
1769
1860
            $recPos += 8;
1770
1861
            last if $recPos + $num * 4 > $recEnd;
1771
 
            my $val = ReadValue($dataPt, $recPos, 'int32u', $num, $num * 4);
 
1862
            my $val = ReadValue($dataPt, $recPos, 'int32s', $num, $num * 4);
1772
1863
            if ($write) {
1773
1864
                # write new value
1774
1865
                my $tagInfo = $$newTags{$tag};
1777
1868
                next unless Image::ExifTool::IsOverwriting($newValueHash, $val);
1778
1869
                my $newVal = Image::ExifTool::GetNewValues($newValueHash);
1779
1870
                next unless defined $newVal;    # can't delete from a custom table
1780
 
                WriteValue($newVal, 'int32u', $num, $dataPt, $recPos);
 
1871
                WriteValue($newVal, 'int32s', $num, $dataPt, $recPos);
1781
1872
                if ($verbose > 1) {
1782
1873
                    $exifTool->VPrint(0, "    - CanonCustom:$$tagInfo{Name} = '$val'\n",
1783
1874
                                         "    + CanonCustom:$$tagInfo{Name} = '$newVal'\n");