~ubuntu-branches/ubuntu/precise/exiv2/precise

« back to all changes in this revision

Viewing changes to src/tiffimage.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Robert Ancell
  • Date: 2011-01-07 09:54:22 UTC
  • mfrom: (1.3.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20110107095422-sz20aod6e1yaorq0
Tags: 0.21-0ubuntu1
* New upstream release
* debian/control:
  - Add Vcs-Bzr link
  - Use standards version 3.9.1
  - Rename libexiv2-9 to libexiv2-10

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
 */
21
21
/*
22
22
  File:      tiffimage.cpp
23
 
  Version:   $Rev: 2243 $
 
23
  Version:   $Rev: 2369 $
24
24
  Author(s): Andreas Huggel (ahu) <ahuggel@gmx.net>
25
25
  History:   15-Mar-06, ahu: created
26
26
 
27
27
 */
28
28
// *****************************************************************************
29
 
#include "rcsid.hpp"
30
 
EXIV2_RCSID("@(#) $Id: tiffimage.cpp 2243 2010-05-28 02:17:37Z ahuggel $")
 
29
#include "rcsid_int.hpp"
 
30
EXIV2_RCSID("@(#) $Id: tiffimage.cpp 2369 2010-10-25 13:16:04Z ahuggel $")
31
31
 
32
32
// *****************************************************************************
33
33
// included header files
80
80
    using namespace Internal;
81
81
 
82
82
    TiffImage::TiffImage(BasicIo::AutoPtr io, bool /*create*/)
83
 
        : Image(ImageType::tiff, mdExif | mdIptc, io)
 
83
        : Image(ImageType::tiff, mdExif | mdIptc, io),
 
84
          pixelWidth_(0), pixelHeight_(0)
84
85
    {
85
86
    } // TiffImage::TiffImage
86
87
 
 
88
    struct MimeTypeList {
 
89
        bool operator==(int compression) const { return compression_ == compression; }
 
90
        int compression_;
 
91
        const char* mimeType_;
 
92
    };
 
93
 
 
94
    MimeTypeList mimeTypeList[] = {
 
95
        { 32770, "image/x-samsung-srw" },
 
96
        { 34713, "image/x-nikon-nef"   },
 
97
        { 65535, "image/x-pentax-pef"  }
 
98
    };
 
99
 
87
100
    std::string TiffImage::mimeType() const
88
101
    {
89
 
        return "image/tiff";
 
102
        if (!mimeType_.empty()) return mimeType_;
 
103
 
 
104
        mimeType_ = std::string("image/tiff");
 
105
        std::string key = "Exif." + primaryGroup() + ".Compression";
 
106
        ExifData::const_iterator md = exifData_.findKey(ExifKey(key));
 
107
        if (md != exifData_.end() && md->count() > 0) {
 
108
            const MimeTypeList* i = find(mimeTypeList, static_cast<int>(md->toLong()));
 
109
            if (i) mimeType_ = std::string(i->mimeType_);
 
110
        }
 
111
        return mimeType_;
90
112
    }
91
113
 
92
114
    std::string TiffImage::primaryGroup() const
93
115
    {
 
116
        if (!primaryGroup_.empty()) return primaryGroup_;
 
117
 
94
118
        static const char* keys[] = {
95
119
            "Exif.Image.NewSubfileType",
96
120
            "Exif.SubImage1.NewSubfileType",
104
128
            "Exif.SubImage9.NewSubfileType"
105
129
        };
106
130
        // Find the group of the primary image, default to "Image"
107
 
        std::string groupName = "Image";
 
131
        primaryGroup_ = std::string("Image");
108
132
        for (unsigned int i = 0; i < EXV_COUNTOF(keys); ++i) {
109
133
            ExifData::const_iterator md = exifData_.findKey(ExifKey(keys[i]));
110
134
            // Is it the primary image?
111
135
            if (md != exifData_.end() && md->count() > 0 && md->toLong() == 0) {
112
 
                groupName = md->groupName();
113
 
                break;
 
136
                // Sometimes there is a JPEG primary image; that's not our first choice
 
137
                primaryGroup_ = md->groupName();
 
138
                std::string key = "Exif." + primaryGroup_ + ".JPEGInterchangeFormat";
 
139
                if (exifData_.findKey(ExifKey(key)) == exifData_.end()) break;
114
140
            }
115
141
        }
116
 
        return groupName;
 
142
        return primaryGroup_;
117
143
    }
118
144
 
119
145
    int TiffImage::pixelWidth() const
120
146
    {
 
147
        if (pixelWidth_ != 0) return pixelWidth_;
 
148
 
121
149
        ExifKey key(std::string("Exif.") + primaryGroup() + std::string(".ImageWidth"));
122
150
        ExifData::const_iterator imageWidth = exifData_.findKey(key);
123
151
        if (imageWidth != exifData_.end() && imageWidth->count() > 0) {
124
 
            return imageWidth->toLong();
 
152
            pixelWidth_ = static_cast<int>(imageWidth->toLong());
125
153
        }
126
 
        return 0;
 
154
        return pixelWidth_;
127
155
    }
128
156
 
129
157
    int TiffImage::pixelHeight() const
130
158
    {
 
159
        if (pixelHeight_ != 0) return pixelHeight_;
 
160
 
131
161
        ExifKey key(std::string("Exif.") + primaryGroup() + std::string(".ImageLength"));
132
162
        ExifData::const_iterator imageHeight = exifData_.findKey(key);
133
163
        if (imageHeight != exifData_.end() && imageHeight->count() > 0) {
134
 
            return imageHeight->toLong();
 
164
            pixelHeight_ = imageHeight->toLong();
135
165
        }
136
 
        return 0;
 
166
        return pixelHeight_;
137
167
    }
138
168
 
139
169
    void TiffImage::setComment(const std::string& /*comment*/)
222
252
 
223
253
        // Delete IFDs which do not occur in TIFF images
224
254
        static const IfdId filteredIfds[] = {
225
 
            panaRawIfdId
 
255
            panaRawId
226
256
        };
227
257
        for (unsigned int i = 0; i < EXV_COUNTOF(filteredIfds); ++i) {
228
258
#ifdef DEBUG
288
318
 
289
319
    //! Canon Camera Settings binary array - configuration
290
320
    extern const ArrayCfg canonCsCfg = {
291
 
        Group::canoncs,   // Group for the elements
 
321
        canonCsId,        // Group for the elements
292
322
        invalidByteOrder, // Use byte order from parent
293
323
        ttUnsignedShort,  // Type for array entry and size element
294
324
        notEncrypted,     // Not encrypted
304
334
 
305
335
    //! Canon Shot Info binary array - configuration
306
336
    extern const ArrayCfg canonSiCfg = {
307
 
        Group::canonsi,   // Group for the elements
 
337
        canonSiId,        // Group for the elements
308
338
        invalidByteOrder, // Use byte order from parent
309
339
        ttUnsignedShort,  // Type for array entry and size element
310
340
        notEncrypted,     // Not encrypted
316
346
 
317
347
    //! Canon Panorama binary array - configuration
318
348
    extern const ArrayCfg canonPaCfg = {
319
 
        Group::canonpa,   // Group for the elements
 
349
        canonPaId,        // Group for the elements
320
350
        invalidByteOrder, // Use byte order from parent
321
351
        ttUnsignedShort,  // Type for array entry and size element
322
352
        notEncrypted,     // Not encrypted
328
358
 
329
359
    //! Canon Custom Function binary array - configuration
330
360
    extern const ArrayCfg canonCfCfg = {
331
 
        Group::canoncf,   // Group for the elements
 
361
        canonCfId,        // Group for the elements
332
362
        invalidByteOrder, // Use byte order from parent
333
363
        ttUnsignedShort,  // Type for array entry and size element
334
364
        notEncrypted,     // Not encrypted
340
370
 
341
371
    //! Canon Picture Info binary array - configuration
342
372
    extern const ArrayCfg canonPiCfg = {
343
 
        Group::canonpi,   // Group for the elements
 
373
        canonPiId,        // Group for the elements
344
374
        invalidByteOrder, // Use byte order from parent
345
375
        ttUnsignedShort,  // Type for array entry and size element
346
376
        notEncrypted,     // Not encrypted
352
382
 
353
383
    //! Canon File Info binary array - configuration
354
384
    extern const ArrayCfg canonFiCfg = {
355
 
        Group::canonfi,   // Group for the elements
 
385
        canonFiId,        // Group for the elements
356
386
        invalidByteOrder, // Use byte order from parent
357
387
        ttUnsignedShort,  // Type for array entry and size element
358
388
        notEncrypted,     // Not encrypted
366
396
        { 2, ttUnsignedLong, 1 }
367
397
    };
368
398
 
 
399
    //! Canon Processing Info binary array - configuration
 
400
    extern const ArrayCfg canonPrCfg = {
 
401
        canonPrId,        // Group for the elements
 
402
        invalidByteOrder, // Use byte order from parent
 
403
        ttUnsignedShort,  // Type for array entry and size element
 
404
        notEncrypted,     // Not encrypted
 
405
        true,             // Has a size element
 
406
        false,            // No fillers
 
407
        false,            // Don't concatenate gaps
 
408
        { 0, ttSignedShort, 1 }
 
409
    };
 
410
 
369
411
    //! Nikon Vibration Reduction binary array - configuration
370
412
    extern const ArrayCfg nikonVrCfg = {
371
 
        Group::nikonvr,   // Group for the elements
 
413
        nikonVrId,        // Group for the elements
372
414
        invalidByteOrder, // Use byte order from parent
373
415
        ttUndefined,      // Type for array entry
374
416
        notEncrypted,     // Not encrypted
385
427
 
386
428
    //! Nikon Picture Control binary array - configuration
387
429
    extern const ArrayCfg nikonPcCfg = {
388
 
        Group::nikonpc,   // Group for the elements
 
430
        nikonPcId,        // Group for the elements
389
431
        invalidByteOrder, // Use byte order from parent
390
432
        ttUndefined,      // Type for array entry
391
433
        notEncrypted,     // Not encrypted
413
455
 
414
456
    //! Nikon World Time binary array - configuration
415
457
    extern const ArrayCfg nikonWtCfg = {
416
 
        Group::nikonwt,   // Group for the elements
 
458
        nikonWtId,        // Group for the elements
417
459
        invalidByteOrder, // Use byte order from parent
418
460
        ttUndefined,      // Type for array entry
419
461
        notEncrypted,     // Not encrypted
431
473
 
432
474
    //! Nikon ISO info binary array - configuration
433
475
    extern const ArrayCfg nikonIiCfg = {
434
 
        Group::nikonii,   // Group for the elements
 
476
        nikonIiId,        // Group for the elements
435
477
        bigEndian,        // Byte order
436
478
        ttUndefined,      // Type for array entry
437
479
        notEncrypted,     // Not encrypted
451
493
 
452
494
    //! Nikon Auto Focus binary array - configuration
453
495
    extern const ArrayCfg nikonAfCfg = {
454
 
        Group::nikonaf,   // Group for the elements
 
496
        nikonAfId,        // Group for the elements
455
497
        littleEndian,     // Byte order
456
498
        ttUndefined,      // Type for array entry
457
499
        notEncrypted,     // Not encrypted
469
511
 
470
512
    //! Nikon Auto Focus 2 binary array - configuration
471
513
    extern const ArrayCfg nikonAf2Cfg = {
472
 
        Group::nikonaf2,   // Group for the elements
 
514
        nikonAf2Id,       // Group for the elements
473
515
        littleEndian,     // Byte order
474
516
        ttUndefined,      // Type for array entry
475
517
        notEncrypted,     // Not encrypted
497
539
 
498
540
    //! Nikon File Info binary array - configuration
499
541
    extern const ArrayCfg nikonFiCfg = {
500
 
        Group::nikonfi,   // Group for the elements
 
542
        nikonFiId,        // Group for the elements
501
543
        littleEndian,     // Byte order
502
544
        ttUndefined,      // Type for array entry
503
545
        notEncrypted,     // Not encrypted
515
557
 
516
558
    //! Nikon Multi Exposure binary array - configuration
517
559
    extern const ArrayCfg nikonMeCfg = {
518
 
        Group::nikonme,   // Group for the elements
 
560
        nikonMeId,        // Group for the elements
519
561
        littleEndian,     // Byte order
520
562
        ttUndefined,      // Type for array entry
521
563
        notEncrypted,     // Not encrypted
534
576
 
535
577
    //! Nikon Flash Info binary array - configuration 1
536
578
    extern const ArrayCfg nikonFl1Cfg = {
537
 
        Group::nikonfl1,  // Group for the elements
 
579
        nikonFl1Id,       // Group for the elements
538
580
        littleEndian,     // Byte order
539
581
        ttUndefined,      // Type for array entry
540
582
        notEncrypted,     // Not encrypted
554
596
        { 13, ttUnsignedByte,  1 }, // RepeatingFlashCount
555
597
        { 14, ttUnsignedByte,  1 }, // FlashGNDistance
556
598
        { 15, ttUnsignedByte,  1 }, // FlashGroupAControlMode
557
 
        { 16, ttUnsignedByte,  1 } // FlashGroupBControlMode
 
599
        { 16, ttUnsignedByte,  1 }  // FlashGroupBControlMode
558
600
    };
559
601
    //! Nikon Flash Info binary array - configuration 2
560
602
    extern const ArrayCfg nikonFl2Cfg = {
561
 
        Group::nikonfl2,  // Group for the elements
 
603
        nikonFl2Id,       // Group for the elements
562
604
        littleEndian,     // Byte order
563
605
        ttUndefined,      // Type for array entry
564
606
        notEncrypted,     // Not encrypted
580
622
    };
581
623
    //! Nikon Flash Info binary array - configuration 3
582
624
    extern const ArrayCfg nikonFl3Cfg = {
583
 
        Group::nikonfl3,  // Group for the elements
 
625
        nikonFl3Id,       // Group for the elements
584
626
        littleEndian,     // Byte order
585
627
        ttUndefined,      // Type for array entry
586
628
        notEncrypted,     // Not encrypted
610
652
 
611
653
    //! Nikon Shot Info binary array - configuration 1 (D80)
612
654
    extern const ArrayCfg nikonSi1Cfg = {
613
 
        Group::nikonsi1,  // Group for the elements
 
655
        nikonSi1Id,       // Group for the elements
614
656
        bigEndian,        // Use byte order from parent
615
657
        ttUndefined,      // Type for array entry
616
658
        nikonCrypt,       // Encryption function
627
669
    };
628
670
    //! Nikon Shot Info binary array - configuration 2 (D40)
629
671
    extern const ArrayCfg nikonSi2Cfg = {
630
 
        Group::nikonsi2,  // Group for the elements
 
672
        nikonSi2Id,       // Group for the elements
631
673
        bigEndian,        // Use byte order from parent
632
674
        ttUndefined,      // Type for array entry
633
675
        nikonCrypt,       // Encryption function
645
687
    };
646
688
    //! Nikon Shot Info binary array - configuration 3 (D300a)
647
689
    extern const ArrayCfg nikonSi3Cfg = {
648
 
        Group::nikonsi3,  // Group for the elements
 
690
        nikonSi3Id,       // Group for the elements
649
691
        bigEndian,        // Use byte order from parent
650
692
        ttUndefined,      // Type for array entry
651
693
        nikonCrypt,       // Encryption function
664
706
    };
665
707
    //! Nikon Shot Info binary array - configuration 4 (D300b)
666
708
    extern const ArrayCfg nikonSi4Cfg = {
667
 
        Group::nikonsi4,  // Group for the elements
 
709
        nikonSi4Id,       // Group for the elements
668
710
        bigEndian,        // Use byte order from parent
669
711
        ttUndefined,      // Type for array entry
670
712
        nikonCrypt,       // Encryption function
682
724
    };
683
725
    //! Nikon Shot Info binary array - configuration 5 (ver 02.xx)
684
726
    extern const ArrayCfg nikonSi5Cfg = {
685
 
        Group::nikonsi5,  // Group for the elements
 
727
        nikonSi5Id,       // Group for the elements
686
728
        bigEndian,        // Use byte order from parent
687
729
        ttUndefined,      // Type for array entry
688
730
        nikonCrypt,       // Encryption function
705
747
    };
706
748
    //! Nikon Shot Info binary array - configuration 6 (ver 01.xx)
707
749
    extern const ArrayCfg nikonSi6Cfg = {
708
 
        Group::nikonsi6,  // Group for the elements
 
750
        nikonSi6Id,       // Group for the elements
709
751
        bigEndian,        // Use byte order from parent
710
752
        ttUndefined,      // Type for array entry
711
753
        notEncrypted,     // Encryption function
726
768
 
727
769
    //! Nikon Lens Data binary array - configuration 1
728
770
    extern const ArrayCfg nikonLd1Cfg = {
729
 
        Group::nikonld1,  // Group for the elements
 
771
        nikonLd1Id,       // Group for the elements
730
772
        invalidByteOrder, // Use byte order from parent
731
773
        ttUndefined,      // Type for array entry
732
774
        notEncrypted,     // Encryption function
737
779
    };
738
780
    //! Nikon Lens Data binary array - configuration 2
739
781
    extern const ArrayCfg nikonLd2Cfg = {
740
 
        Group::nikonld2,  // Group for the elements
 
782
        nikonLd2Id,       // Group for the elements
741
783
        invalidByteOrder, // Use byte order from parent
742
784
        ttUndefined,      // Type for array entry
743
785
        nikonCrypt,       // Encryption function
748
790
    };
749
791
    //! Nikon Lens Data binary array - configuration 3
750
792
    extern const ArrayCfg nikonLd3Cfg = {
751
 
        Group::nikonld3,  // Group for the elements
 
793
        nikonLd3Id,       // Group for the elements
752
794
        invalidByteOrder, // Use byte order from parent
753
795
        ttUndefined,      // Type for array entry
754
796
        nikonCrypt,       // Encryption function
770
812
 
771
813
    //! Nikon Color Balance binary array - configuration 1
772
814
    extern const ArrayCfg nikonCb1Cfg = {
773
 
        Group::nikoncb1,  // Group for the elements
 
815
        nikonCb1Id,       // Group for the elements
774
816
        invalidByteOrder, // Use byte order from parent
775
817
        ttUndefined,      // Type for array entry
776
818
        notEncrypted,     // Encryption function
781
823
    };
782
824
    //! Nikon Color Balance binary array - configuration 2
783
825
    extern const ArrayCfg nikonCb2Cfg = {
784
 
        Group::nikoncb2,  // Group for the elements
 
826
        nikonCb2Id,       // Group for the elements
785
827
        invalidByteOrder, // Use byte order from parent
786
828
        ttUndefined,      // Type for array entry
787
829
        nikonCrypt,       // Encryption function
792
834
    };
793
835
    //! Nikon Color Balance binary array - configuration 2a
794
836
    extern const ArrayCfg nikonCb2aCfg = {
795
 
        Group::nikoncb2a, // Group for the elements
 
837
        nikonCb2aId,      // Group for the elements
796
838
        invalidByteOrder, // Use byte order from parent
797
839
        ttUndefined,      // Type for array entry
798
840
        nikonCrypt,       // Encryption function
803
845
    };
804
846
    //! Nikon Color Balance binary array - configuration 2b
805
847
    extern const ArrayCfg nikonCb2bCfg = {
806
 
        Group::nikoncb2b, // Group for the elements
 
848
        nikonCb2bId,      // Group for the elements
807
849
        invalidByteOrder, // Use byte order from parent
808
850
        ttUndefined,      // Type for array entry
809
851
        nikonCrypt,       // Encryption function
814
856
    };
815
857
    //! Nikon Color Balance binary array - configuration 3
816
858
    extern const ArrayCfg nikonCb3Cfg = {
817
 
        Group::nikoncb3,  // Group for the elements
 
859
        nikonCb3Id,       // Group for the elements
818
860
        invalidByteOrder, // Use byte order from parent
819
861
        ttUndefined,      // Type for array entry
820
862
        notEncrypted,     // Encryption function
825
867
    };
826
868
    //! Nikon Color Balance binary array - configuration 4
827
869
    extern const ArrayCfg nikonCb4Cfg = {
828
 
        Group::nikoncb4,  // Group for the elements
 
870
        nikonCb4Id,       // Group for the elements
829
871
        invalidByteOrder, // Use byte order from parent
830
872
        ttUndefined,      // Type for array entry
831
873
        nikonCrypt,       // Encryption function
880
922
 
881
923
    //! Minolta Camera Settings (old) binary array - configuration
882
924
    extern const ArrayCfg minoCsoCfg = {
883
 
        Group::minocso,   // Group for the elements
 
925
        minoltaCsOldId,   // Group for the elements
884
926
        bigEndian,        // Big endian
885
927
        ttUndefined,      // Type for array entry and size element
886
928
        notEncrypted,     // Not encrypted
892
934
 
893
935
    //! Minolta Camera Settings (new) binary array - configuration
894
936
    extern const ArrayCfg minoCsnCfg = {
895
 
        Group::minocsn,   // Group for the elements
 
937
        minoltaCsNewId,   // Group for the elements
896
938
        bigEndian,        // Big endian
897
939
        ttUndefined,      // Type for array entry and size element
898
940
        notEncrypted,     // Not encrypted
904
946
 
905
947
    //! Minolta 7D Camera Settings binary array - configuration
906
948
    extern const ArrayCfg minoCs7Cfg = {
907
 
        Group::minocs7,   // Group for the elements
 
949
        minoltaCs7DId,    // Group for the elements
908
950
        bigEndian,        // Big endian
909
951
        ttUndefined,      // Type for array entry and size element
910
952
        notEncrypted,     // Not encrypted
921
963
 
922
964
    //! Minolta 5D Camera Settings binary array - configuration
923
965
    extern const ArrayCfg minoCs5Cfg = {
924
 
        Group::minocs5,   // Group for the elements
 
966
        minoltaCs5DId,    // Group for the elements
925
967
        bigEndian,        // Big endian
926
968
        ttUndefined,      // Type for array entry and size element
927
969
        notEncrypted,     // Not encrypted
942
984
 
943
985
    //! Sony1 Camera Settings binary array - configuration
944
986
    extern const ArrayCfg sony1CsCfg = {
945
 
        Group::sony1cs,   // Group for the elements
 
987
        sony1CsId,        // Group for the elements
946
988
        bigEndian,        // Big endian
947
989
        ttUndefined,      // Type for array entry and size element
948
990
        notEncrypted,     // Not encrypted
953
995
    };
954
996
    //! Sony1 Camera Settings 2 binary array - configuration
955
997
    extern const ArrayCfg sony1Cs2Cfg = {
956
 
        Group::sony1cs2,  // Group for the elements
 
998
        sony1Cs2Id,       // Group for the elements
957
999
        bigEndian,        // Big endian
958
1000
        ttUndefined,      // Type for array entry and size element
959
1001
        notEncrypted,     // Not encrypted
968
1010
    };
969
1011
    //! Sony2 Camera Settings binary array - configuration
970
1012
    extern const ArrayCfg sony2CsCfg = {
971
 
        Group::sony2cs,   // Group for the elements
 
1013
        sony2CsId,        // Group for the elements
972
1014
        bigEndian,        // Big endian
973
1015
        ttUndefined,      // Type for array entry and size element
974
1016
        notEncrypted,     // Not encrypted
979
1021
    };
980
1022
    //! Sony2 Camera Settings 2 binary array - configuration
981
1023
    extern const ArrayCfg sony2Cs2Cfg = {
982
 
        Group::sony2cs2,  // Group for the elements
 
1024
        sony2Cs2Id,       // Group for the elements
983
1025
        bigEndian,        // Big endian
984
1026
        ttUndefined,      // Type for array entry and size element
985
1027
        notEncrypted,     // Not encrypted
1005
1047
 
1006
1048
    //! Sony Minolta Camera Settings (old) binary array - configuration
1007
1049
    extern const ArrayCfg sony1MCsoCfg = {
1008
 
        Group::sony1mcso, // Group for the elements
 
1050
        sony1MltCsOldId,  // Group for the elements
1009
1051
        bigEndian,        // Big endian
1010
1052
        ttUndefined,      // Type for array entry and size element
1011
1053
        notEncrypted,     // Not encrypted
1017
1059
 
1018
1060
    //! Sony Minolta Camera Settings (new) binary array - configuration
1019
1061
    extern const ArrayCfg sony1MCsnCfg = {
1020
 
        Group::sony1mcsn, // Group for the elements
 
1062
        sony1MltCsNewId,  // Group for the elements
1021
1063
        bigEndian,        // Big endian
1022
1064
        ttUndefined,      // Type for array entry and size element
1023
1065
        notEncrypted,     // Not encrypted
1029
1071
 
1030
1072
    //! Sony Minolta 7D Camera Settings binary array - configuration
1031
1073
    extern const ArrayCfg sony1MCs7Cfg = {
1032
 
        Group::sony1mcs7, // Group for the elements
 
1074
        sony1MltCs7DId,   // Group for the elements
1033
1075
        bigEndian,        // Big endian
1034
1076
        ttUndefined,      // Type for array entry and size element
1035
1077
        notEncrypted,     // Not encrypted
1041
1083
 
1042
1084
    //! Sony Minolta A100 Camera Settings binary array - configuration
1043
1085
    extern const ArrayCfg sony1MCsA100Cfg = {
1044
 
        Group::sony1mcsa100, // Group for the elements
 
1086
        sony1MltCsA100Id, // Group for the elements
1045
1087
        bigEndian,        // Big endian
1046
1088
        ttUndefined,      // Type for array entry and size element
1047
1089
        notEncrypted,     // Not encrypted
1069
1111
    const TiffTreeStruct TiffCreator::tiffTreeStruct_[] = {
1070
1112
        // root      group             parent group      parent tag
1071
1113
        //---------  ----------------- ----------------- ----------
1072
 
        { Tag::root, Group::none,      Group::none,      Tag::root },
1073
 
        { Tag::root, Group::ifd0,      Group::none,      Tag::root },
1074
 
        { Tag::root, Group::subimg1,   Group::ifd0,      0x014a    },
1075
 
        { Tag::root, Group::subimg2,   Group::ifd0,      0x014a    },
1076
 
        { Tag::root, Group::subimg3,   Group::ifd0,      0x014a    },
1077
 
        { Tag::root, Group::subimg4,   Group::ifd0,      0x014a    },
1078
 
        { Tag::root, Group::subimg5,   Group::ifd0,      0x014a    },
1079
 
        { Tag::root, Group::subimg6,   Group::ifd0,      0x014a    },
1080
 
        { Tag::root, Group::subimg7,   Group::ifd0,      0x014a    },
1081
 
        { Tag::root, Group::subimg8,   Group::ifd0,      0x014a    },
1082
 
        { Tag::root, Group::subimg9,   Group::ifd0,      0x014a    },
1083
 
        { Tag::root, Group::exif,      Group::ifd0,      0x8769    },
1084
 
        { Tag::root, Group::gps,       Group::ifd0,      0x8825    },
1085
 
        { Tag::root, Group::iop,       Group::exif,      0xa005    },
1086
 
        { Tag::root, Group::ifd1,      Group::ifd0,      Tag::next },
1087
 
        { Tag::root, Group::ifd2,      Group::ifd1,      Tag::next },
1088
 
        { Tag::root, Group::ifd3,      Group::ifd2,      Tag::next },
1089
 
        { Tag::root, Group::olymp1mn,  Group::exif,      0x927c    },
1090
 
        { Tag::root, Group::olymp2mn,  Group::exif,      0x927c    },
1091
 
        { Tag::root, Group::olympeq,   Group::olymp2mn,  0x2010    },
1092
 
        { Tag::root, Group::olympcs,   Group::olymp2mn,  0x2020    },
1093
 
        { Tag::root, Group::olymprd,   Group::olymp2mn,  0x2030    },
1094
 
        { Tag::root, Group::olymprd2,  Group::olymp2mn,  0x2031    },
1095
 
        { Tag::root, Group::olympip,   Group::olymp2mn,  0x2040    },
1096
 
        { Tag::root, Group::olympfi,   Group::olymp2mn,  0x2050    },
1097
 
        { Tag::root, Group::olympfe1,  Group::olymp2mn,  0x2100    },
1098
 
        { Tag::root, Group::olympfe2,  Group::olymp2mn,  0x2200    },
1099
 
        { Tag::root, Group::olympfe3,  Group::olymp2mn,  0x2300    },
1100
 
        { Tag::root, Group::olympfe4,  Group::olymp2mn,  0x2400    },
1101
 
        { Tag::root, Group::olympfe5,  Group::olymp2mn,  0x2500    },
1102
 
        { Tag::root, Group::olympfe6,  Group::olymp2mn,  0x2600    },
1103
 
        { Tag::root, Group::olympfe7,  Group::olymp2mn,  0x2700    },
1104
 
        { Tag::root, Group::olympfe8,  Group::olymp2mn,  0x2800    },
1105
 
        { Tag::root, Group::olympfe9,  Group::olymp2mn,  0x2900    },
1106
 
        { Tag::root, Group::olympri,   Group::olymp2mn,  0x3000    },
1107
 
        { Tag::root, Group::fujimn,    Group::exif,      0x927c    },
1108
 
        { Tag::root, Group::canonmn,   Group::exif,      0x927c    },
1109
 
        { Tag::root, Group::canoncs,   Group::canonmn,   0x0001    },
1110
 
        { Tag::root, Group::canonsi,   Group::canonmn,   0x0004    },
1111
 
        { Tag::root, Group::canonpa,   Group::canonmn,   0x0005    },
1112
 
        { Tag::root, Group::canoncf,   Group::canonmn,   0x000f    },
1113
 
        { Tag::root, Group::canonpi,   Group::canonmn,   0x0012    },
1114
 
        { Tag::root, Group::canonfi,   Group::canonmn,   0x0093    },
1115
 
        { Tag::root, Group::nikon1mn,  Group::exif,      0x927c    },
1116
 
        { Tag::root, Group::nikon2mn,  Group::exif,      0x927c    },
1117
 
        { Tag::root, Group::nikon3mn,  Group::exif,      0x927c    },
1118
 
        { Tag::root, Group::nikonpv,   Group::nikon3mn,  0x0011    },
1119
 
        { Tag::root, Group::nikonvr,   Group::nikon3mn,  0x001f    },
1120
 
        { Tag::root, Group::nikonpc,   Group::nikon3mn,  0x0023    },
1121
 
        { Tag::root, Group::nikonwt,   Group::nikon3mn,  0x0024    },
1122
 
        { Tag::root, Group::nikonii,   Group::nikon3mn,  0x0025    },
1123
 
        { Tag::root, Group::nikonaf,   Group::nikon3mn,  0x0088    },
1124
 
        { Tag::root, Group::nikonsi1,  Group::nikon3mn,  0x0091    },
1125
 
        { Tag::root, Group::nikonsi2,  Group::nikon3mn,  0x0091    },
1126
 
        { Tag::root, Group::nikonsi3,  Group::nikon3mn,  0x0091    },
1127
 
        { Tag::root, Group::nikonsi4,  Group::nikon3mn,  0x0091    },
1128
 
        { Tag::root, Group::nikonsi5,  Group::nikon3mn,  0x0091    },
1129
 
        { Tag::root, Group::nikonsi6,  Group::nikon3mn,  0x0091    },
1130
 
        { Tag::root, Group::nikoncb1,  Group::nikon3mn,  0x0097    },
1131
 
        { Tag::root, Group::nikoncb2,  Group::nikon3mn,  0x0097    },
1132
 
        { Tag::root, Group::nikoncb2a, Group::nikon3mn,  0x0097    },
1133
 
        { Tag::root, Group::nikoncb2b, Group::nikon3mn,  0x0097    },
1134
 
        { Tag::root, Group::nikoncb3,  Group::nikon3mn,  0x0097    },
1135
 
        { Tag::root, Group::nikoncb4,  Group::nikon3mn,  0x0097    },
1136
 
        { Tag::root, Group::nikonld1,  Group::nikon3mn,  0x0098    },
1137
 
        { Tag::root, Group::nikonld2,  Group::nikon3mn,  0x0098    },
1138
 
        { Tag::root, Group::nikonld3,  Group::nikon3mn,  0x0098    },
1139
 
        { Tag::root, Group::nikonme,   Group::nikon3mn,  0x00b0    },
1140
 
        { Tag::root, Group::nikonaf2,  Group::nikon3mn,  0x00b7    },
1141
 
        { Tag::root, Group::nikonfi,   Group::nikon3mn,  0x00b8    },
1142
 
        { Tag::root, Group::nikonfl1,  Group::nikon3mn,  0x00a8    },
1143
 
        { Tag::root, Group::nikonfl2,  Group::nikon3mn,  0x00a8    },
1144
 
        { Tag::root, Group::nikonfl3,  Group::nikon3mn,  0x00a8    },
1145
 
        { Tag::root, Group::panamn,    Group::exif,      0x927c    },
1146
 
        { Tag::root, Group::pentaxmn,  Group::exif,      0x927c    },
1147
 
        { Tag::root, Group::sigmamn,   Group::exif,      0x927c    },
1148
 
        { Tag::root, Group::sony1mn,   Group::exif,      0x927c    },
1149
 
        { Tag::root, Group::sony1cs,   Group::sony1mn,   0x0114    },
1150
 
        { Tag::root, Group::sony1cs2,  Group::sony1mn,   0x0114    },
1151
 
        { Tag::root, Group::sonymltmn, Group::sony1mn,   0xb028    },
1152
 
        { Tag::root, Group::sony1mcso, Group::sonymltmn, 0x0001    },
1153
 
        { Tag::root, Group::sony1mcsn, Group::sonymltmn, 0x0003    },
1154
 
        { Tag::root, Group::sony1mcs7, Group::sonymltmn, 0x0004    },
1155
 
        { Tag::root, Group::sony1mcsa100, Group::sonymltmn, 0x0114 },
1156
 
        { Tag::root, Group::sony2mn,   Group::exif,      0x927c    },
1157
 
        { Tag::root, Group::sony2cs,   Group::sony2mn,   0x0114    },
1158
 
        { Tag::root, Group::sony2cs2,  Group::sony2mn,   0x0114    },
1159
 
        { Tag::root, Group::minoltamn, Group::exif,      0x927c    },
1160
 
        { Tag::root, Group::minocso,   Group::minoltamn, 0x0001    },
1161
 
        { Tag::root, Group::minocsn,   Group::minoltamn, 0x0003    },
1162
 
        { Tag::root, Group::minocs7,   Group::minoltamn, 0x0004    },
1163
 
        { Tag::root, Group::minocs5,   Group::minoltamn, 0x0114    },
 
1114
        { Tag::root, ifdIdNotSet,      ifdIdNotSet,      Tag::root },
 
1115
        { Tag::root, ifd0Id,           ifdIdNotSet,      Tag::root },
 
1116
        { Tag::root, subImage1Id,      ifd0Id,           0x014a    },
 
1117
        { Tag::root, subImage2Id,      ifd0Id,           0x014a    },
 
1118
        { Tag::root, subImage3Id,      ifd0Id,           0x014a    },
 
1119
        { Tag::root, subImage4Id,      ifd0Id,           0x014a    },
 
1120
        { Tag::root, subImage5Id,      ifd0Id,           0x014a    },
 
1121
        { Tag::root, subImage6Id,      ifd0Id,           0x014a    },
 
1122
        { Tag::root, subImage7Id,      ifd0Id,           0x014a    },
 
1123
        { Tag::root, subImage8Id,      ifd0Id,           0x014a    },
 
1124
        { Tag::root, subImage9Id,      ifd0Id,           0x014a    },
 
1125
        { Tag::root, exifId,           ifd0Id,           0x8769    },
 
1126
        { Tag::root, gpsId,            ifd0Id,           0x8825    },
 
1127
        { Tag::root, iopId,            exifId,           0xa005    },
 
1128
        { Tag::root, ifd1Id,           ifd0Id,           Tag::next },
 
1129
        { Tag::root, ifd2Id,           ifd1Id,           Tag::next },
 
1130
        { Tag::root, ifd3Id,           ifd2Id,           Tag::next },
 
1131
        { Tag::root, olympusId,        exifId,           0x927c    },
 
1132
        { Tag::root, olympus2Id,       exifId,           0x927c    },
 
1133
        { Tag::root, subThumb1Id,      ifd1Id,           0x014a    },
 
1134
        { Tag::root, olympusEqId,      olympus2Id,       0x2010    },
 
1135
        { Tag::root, olympusCsId,      olympus2Id,       0x2020    },
 
1136
        { Tag::root, olympusRdId,      olympus2Id,       0x2030    },
 
1137
        { Tag::root, olympusRd2Id,     olympus2Id,       0x2031    },
 
1138
        { Tag::root, olympusIpId,      olympus2Id,       0x2040    },
 
1139
        { Tag::root, olympusFiId,      olympus2Id,       0x2050    },
 
1140
        { Tag::root, olympusFe1Id,     olympus2Id,       0x2100    },
 
1141
        { Tag::root, olympusFe2Id,     olympus2Id,       0x2200    },
 
1142
        { Tag::root, olympusFe3Id,     olympus2Id,       0x2300    },
 
1143
        { Tag::root, olympusFe4Id,     olympus2Id,       0x2400    },
 
1144
        { Tag::root, olympusFe5Id,     olympus2Id,       0x2500    },
 
1145
        { Tag::root, olympusFe6Id,     olympus2Id,       0x2600    },
 
1146
        { Tag::root, olympusFe7Id,     olympus2Id,       0x2700    },
 
1147
        { Tag::root, olympusFe8Id,     olympus2Id,       0x2800    },
 
1148
        { Tag::root, olympusFe9Id,     olympus2Id,       0x2900    },
 
1149
        { Tag::root, olympusRiId,      olympus2Id,       0x3000    },
 
1150
        { Tag::root, fujiId,           exifId,           0x927c    },
 
1151
        { Tag::root, canonId,          exifId,           0x927c    },
 
1152
        { Tag::root, canonCsId,        canonId,          0x0001    },
 
1153
        { Tag::root, canonSiId,        canonId,          0x0004    },
 
1154
        { Tag::root, canonPaId,        canonId,          0x0005    },
 
1155
        { Tag::root, canonCfId,        canonId,          0x000f    },
 
1156
        { Tag::root, canonPiId,        canonId,          0x0012    },
 
1157
        { Tag::root, canonFiId,        canonId,          0x0093    },
 
1158
        { Tag::root, canonPrId,        canonId,          0x00a0    },
 
1159
        { Tag::root, nikon1Id,         exifId,           0x927c    },
 
1160
        { Tag::root, nikon2Id,         exifId,           0x927c    },
 
1161
        { Tag::root, nikon3Id,         exifId,           0x927c    },
 
1162
        { Tag::root, nikonPvId,        nikon3Id,         0x0011    },
 
1163
        { Tag::root, nikonVrId,        nikon3Id,         0x001f    },
 
1164
        { Tag::root, nikonPcId,        nikon3Id,         0x0023    },
 
1165
        { Tag::root, nikonWtId,        nikon3Id,         0x0024    },
 
1166
        { Tag::root, nikonIiId,        nikon3Id,         0x0025    },
 
1167
        { Tag::root, nikonAfId,        nikon3Id,         0x0088    },
 
1168
        { Tag::root, nikonSi1Id,       nikon3Id,         0x0091    },
 
1169
        { Tag::root, nikonSi2Id,       nikon3Id,         0x0091    },
 
1170
        { Tag::root, nikonSi3Id,       nikon3Id,         0x0091    },
 
1171
        { Tag::root, nikonSi4Id,       nikon3Id,         0x0091    },
 
1172
        { Tag::root, nikonSi5Id,       nikon3Id,         0x0091    },
 
1173
        { Tag::root, nikonSi6Id,       nikon3Id,         0x0091    },
 
1174
        { Tag::root, nikonCb1Id,       nikon3Id,         0x0097    },
 
1175
        { Tag::root, nikonCb2Id,       nikon3Id,         0x0097    },
 
1176
        { Tag::root, nikonCb2aId,      nikon3Id,         0x0097    },
 
1177
        { Tag::root, nikonCb2bId,      nikon3Id,         0x0097    },
 
1178
        { Tag::root, nikonCb3Id,       nikon3Id,         0x0097    },
 
1179
        { Tag::root, nikonCb4Id,       nikon3Id,         0x0097    },
 
1180
        { Tag::root, nikonLd1Id,       nikon3Id,         0x0098    },
 
1181
        { Tag::root, nikonLd2Id,       nikon3Id,         0x0098    },
 
1182
        { Tag::root, nikonLd3Id,       nikon3Id,         0x0098    },
 
1183
        { Tag::root, nikonMeId,        nikon3Id,         0x00b0    },
 
1184
        { Tag::root, nikonAf2Id,       nikon3Id,         0x00b7    },
 
1185
        { Tag::root, nikonFiId,        nikon3Id,         0x00b8    },
 
1186
        { Tag::root, nikonFl1Id,       nikon3Id,         0x00a8    },
 
1187
        { Tag::root, nikonFl2Id,       nikon3Id,         0x00a8    },
 
1188
        { Tag::root, nikonFl3Id,       nikon3Id,         0x00a8    },
 
1189
        { Tag::root, panasonicId,      exifId,           0x927c    },
 
1190
        { Tag::root, pentaxId,         exifId,           0x927c    },
 
1191
        { Tag::root, samsung2Id,       exifId,           0x927c    },
 
1192
        { Tag::root, samsungPvId,      samsung2Id,       0x0035    },
 
1193
        { Tag::root, sigmaId,          exifId,           0x927c    },
 
1194
        { Tag::root, sony1Id,          exifId,           0x927c    },
 
1195
        { Tag::root, sony1CsId,        sony1Id,          0x0114    },
 
1196
        { Tag::root, sony1Cs2Id,       sony1Id,          0x0114    },
 
1197
        { Tag::root, sonyMltId,        sony1Id,          0xb028    },
 
1198
        { Tag::root, sony1MltCsOldId,  sonyMltId,        0x0001    },
 
1199
        { Tag::root, sony1MltCsNewId,  sonyMltId,        0x0003    },
 
1200
        { Tag::root, sony1MltCs7DId,   sonyMltId,        0x0004    },
 
1201
        { Tag::root, sony1MltCsA100Id, sonyMltId,        0x0114    },
 
1202
        { Tag::root, sony2Id,          exifId,           0x927c    },
 
1203
        { Tag::root, sony2CsId,        sony2Id,          0x0114    },
 
1204
        { Tag::root, sony2Cs2Id,       sony2Id,          0x0114    },
 
1205
        { Tag::root, minoltaId,        exifId,           0x927c    },
 
1206
        { Tag::root, minoltaCsOldId,   minoltaId,        0x0001    },
 
1207
        { Tag::root, minoltaCsNewId,   minoltaId,        0x0003    },
 
1208
        { Tag::root, minoltaCs7DId,    minoltaId,        0x0004    },
 
1209
        { Tag::root, minoltaCs5DId,    minoltaId,        0x0114    },
1164
1210
        // ---------------------------------------------------------
1165
1211
        // Panasonic RW2 raw images
1166
 
        { Tag::pana, Group::none,      Group::none,      Tag::pana },
1167
 
        { Tag::pana, Group::panaraw,   Group::none,      Tag::pana },
1168
 
        { Tag::pana, Group::exif,      Group::panaraw,   0x8769    },
1169
 
        { Tag::pana, Group::gps,       Group::panaraw,   0x8825    }
 
1212
        { Tag::pana, ifdIdNotSet,      ifdIdNotSet,      Tag::pana },
 
1213
        { Tag::pana, panaRawId,        ifdIdNotSet,      Tag::pana },
 
1214
        { Tag::pana, exifId,           panaRawId,        0x8769    },
 
1215
        { Tag::pana, gpsId,            panaRawId,        0x8825    }
1170
1216
    };
1171
1217
 
1172
1218
    /*
1184
1230
        // ext. tag  group             create function
1185
1231
        //---------  ----------------- -----------------------------------------
1186
1232
        // Root directory
1187
 
        { Tag::root, Group::none,      newTiffDirectory<Group::ifd0>             },
 
1233
        { Tag::root, ifdIdNotSet,      newTiffDirectory<ifd0Id>                  },
1188
1234
 
1189
1235
        // IFD0
1190
 
        {    0x8769, Group::ifd0,      newTiffSubIfd<Group::exif>                },
1191
 
        {    0x8825, Group::ifd0,      newTiffSubIfd<Group::gps>                 },
1192
 
        {    0x0111, Group::ifd0,      newTiffImageData<0x0117, Group::ifd0>     },
1193
 
        {    0x0117, Group::ifd0,      newTiffImageSize<0x0111, Group::ifd0>     },
1194
 
        {    0x0144, Group::ifd0,      newTiffImageData<0x0145, Group::ifd0>     },
1195
 
        {    0x0145, Group::ifd0,      newTiffImageSize<0x0144, Group::ifd0>     },
1196
 
        {    0x0201, Group::ifd0,      newTiffImageData<0x0202, Group::ifd0>     },
1197
 
        {    0x0202, Group::ifd0,      newTiffImageSize<0x0201, Group::ifd0>     },
1198
 
        {    0x014a, Group::ifd0,      newTiffSubIfd<Group::subimg1>             },
1199
 
        { Tag::next, Group::ifd0,      newTiffDirectory<Group::ifd1>             },
1200
 
        {  Tag::all, Group::ifd0,      newTiffEntry                              },
1201
 
 
1202
 
        // Subdir subimg1
1203
 
        {    0x0111, Group::subimg1,   newTiffImageData<0x0117, Group::subimg1>  },
1204
 
        {    0x0117, Group::subimg1,   newTiffImageSize<0x0111, Group::subimg1>  },
1205
 
        {    0x0144, Group::subimg1,   newTiffImageData<0x0145, Group::subimg1>  },
1206
 
        {    0x0145, Group::subimg1,   newTiffImageSize<0x0144, Group::subimg1>  },
1207
 
        {    0x0201, Group::subimg1,   newTiffImageData<0x0202, Group::subimg1>  },
1208
 
        {    0x0202, Group::subimg1,   newTiffImageSize<0x0201, Group::subimg1>  },
1209
 
        { Tag::next, Group::subimg1,   newTiffDirectory<Group::ignr>             },
1210
 
        {  Tag::all, Group::subimg1,   newTiffEntry                              },
1211
 
 
1212
 
        // Subdir subimg2
1213
 
        {    0x0111, Group::subimg2,   newTiffImageData<0x0117, Group::subimg2>  },
1214
 
        {    0x0117, Group::subimg2,   newTiffImageSize<0x0111, Group::subimg2>  },
1215
 
        {    0x0144, Group::subimg2,   newTiffImageData<0x0145, Group::subimg2>  },
1216
 
        {    0x0145, Group::subimg2,   newTiffImageSize<0x0144, Group::subimg2>  },
1217
 
        {    0x0201, Group::subimg2,   newTiffImageData<0x0202, Group::subimg2>  },
1218
 
        {    0x0202, Group::subimg2,   newTiffImageSize<0x0201, Group::subimg2>  },
1219
 
        { Tag::next, Group::subimg2,   newTiffDirectory<Group::ignr>             },
1220
 
        {  Tag::all, Group::subimg2,   newTiffEntry                              },
1221
 
 
1222
 
        // Subdir subimg3
1223
 
        {    0x0111, Group::subimg3,   newTiffImageData<0x0117, Group::subimg3>  },
1224
 
        {    0x0117, Group::subimg3,   newTiffImageSize<0x0111, Group::subimg3>  },
1225
 
        {    0x0144, Group::subimg3,   newTiffImageData<0x0145, Group::subimg3>  },
1226
 
        {    0x0145, Group::subimg3,   newTiffImageSize<0x0144, Group::subimg3>  },
1227
 
        {    0x0201, Group::subimg3,   newTiffImageData<0x0202, Group::subimg3>  },
1228
 
        {    0x0202, Group::subimg3,   newTiffImageSize<0x0201, Group::subimg3>  },
1229
 
        { Tag::next, Group::subimg3,   newTiffDirectory<Group::ignr>             },
1230
 
        {  Tag::all, Group::subimg3,   newTiffEntry                              },
1231
 
 
1232
 
        // Subdir subimg4
1233
 
        {    0x0111, Group::subimg4,   newTiffImageData<0x0117, Group::subimg4>  },
1234
 
        {    0x0117, Group::subimg4,   newTiffImageSize<0x0111, Group::subimg4>  },
1235
 
        {    0x0144, Group::subimg4,   newTiffImageData<0x0145, Group::subimg4>  },
1236
 
        {    0x0145, Group::subimg4,   newTiffImageSize<0x0144, Group::subimg4>  },
1237
 
        {    0x0201, Group::subimg4,   newTiffImageData<0x0202, Group::subimg4>  },
1238
 
        {    0x0202, Group::subimg4,   newTiffImageSize<0x0201, Group::subimg4>  },
1239
 
        { Tag::next, Group::subimg4,   newTiffDirectory<Group::ignr>             },
1240
 
        {  Tag::all, Group::subimg4,   newTiffEntry                              },
1241
 
 
1242
 
        // Subdir subimg5
1243
 
        {    0x0111, Group::subimg5,   newTiffImageData<0x0117, Group::subimg5>  },
1244
 
        {    0x0117, Group::subimg5,   newTiffImageSize<0x0111, Group::subimg5>  },
1245
 
        {    0x0144, Group::subimg5,   newTiffImageData<0x0145, Group::subimg5>  },
1246
 
        {    0x0145, Group::subimg5,   newTiffImageSize<0x0144, Group::subimg5>  },
1247
 
        {    0x0201, Group::subimg5,   newTiffImageData<0x0202, Group::subimg5>  },
1248
 
        {    0x0202, Group::subimg5,   newTiffImageSize<0x0201, Group::subimg5>  },
1249
 
        { Tag::next, Group::subimg5,   newTiffDirectory<Group::ignr>             },
1250
 
        {  Tag::all, Group::subimg5,   newTiffEntry                              },
1251
 
 
1252
 
        // Subdir subimg6
1253
 
        {    0x0111, Group::subimg6,   newTiffImageData<0x0117, Group::subimg6>  },
1254
 
        {    0x0117, Group::subimg6,   newTiffImageSize<0x0111, Group::subimg6>  },
1255
 
        {    0x0144, Group::subimg6,   newTiffImageData<0x0145, Group::subimg6>  },
1256
 
        {    0x0145, Group::subimg6,   newTiffImageSize<0x0144, Group::subimg6>  },
1257
 
        {    0x0201, Group::subimg6,   newTiffImageData<0x0202, Group::subimg6>  },
1258
 
        {    0x0202, Group::subimg6,   newTiffImageSize<0x0201, Group::subimg6>  },
1259
 
        { Tag::next, Group::subimg6,   newTiffDirectory<Group::ignr>             },
1260
 
        {  Tag::all, Group::subimg6,   newTiffEntry                              },
1261
 
 
1262
 
        // Subdir subimg7
1263
 
        {    0x0111, Group::subimg7,   newTiffImageData<0x0117, Group::subimg7>  },
1264
 
        {    0x0117, Group::subimg7,   newTiffImageSize<0x0111, Group::subimg7>  },
1265
 
        {    0x0144, Group::subimg7,   newTiffImageData<0x0145, Group::subimg7>  },
1266
 
        {    0x0145, Group::subimg7,   newTiffImageSize<0x0144, Group::subimg7>  },
1267
 
        {    0x0201, Group::subimg7,   newTiffImageData<0x0202, Group::subimg7>  },
1268
 
        {    0x0202, Group::subimg7,   newTiffImageSize<0x0201, Group::subimg7>  },
1269
 
        { Tag::next, Group::subimg7,   newTiffDirectory<Group::ignr>             },
1270
 
        {  Tag::all, Group::subimg7,   newTiffEntry                              },
1271
 
 
1272
 
        // Subdir subimg8
1273
 
        {    0x0111, Group::subimg8,   newTiffImageData<0x0117, Group::subimg8>  },
1274
 
        {    0x0117, Group::subimg8,   newTiffImageSize<0x0111, Group::subimg8>  },
1275
 
        {    0x0144, Group::subimg8,   newTiffImageData<0x0145, Group::subimg8>  },
1276
 
        {    0x0145, Group::subimg8,   newTiffImageSize<0x0144, Group::subimg8>  },
1277
 
        {    0x0201, Group::subimg8,   newTiffImageData<0x0202, Group::subimg8>  },
1278
 
        {    0x0202, Group::subimg8,   newTiffImageSize<0x0201, Group::subimg8>  },
1279
 
        { Tag::next, Group::subimg8,   newTiffDirectory<Group::ignr>             },
1280
 
        {  Tag::all, Group::subimg8,   newTiffEntry                              },
1281
 
 
1282
 
        // Subdir subimg9
1283
 
        {    0x0111, Group::subimg9,   newTiffImageData<0x0117, Group::subimg9>  },
1284
 
        {    0x0117, Group::subimg9,   newTiffImageSize<0x0111, Group::subimg9>  },
1285
 
        {    0x0144, Group::subimg9,   newTiffImageData<0x0145, Group::subimg9>  },
1286
 
        {    0x0145, Group::subimg9,   newTiffImageSize<0x0144, Group::subimg9>  },
1287
 
        {    0x0201, Group::subimg9,   newTiffImageData<0x0202, Group::subimg9>  },
1288
 
        {    0x0202, Group::subimg9,   newTiffImageSize<0x0201, Group::subimg9>  },
1289
 
        { Tag::next, Group::subimg9,   newTiffDirectory<Group::ignr>             },
1290
 
        {  Tag::all, Group::subimg9,   newTiffEntry                              },
 
1236
        {    0x8769, ifd0Id,           newTiffSubIfd<exifId>                     },
 
1237
        {    0x8825, ifd0Id,           newTiffSubIfd<gpsId>                      },
 
1238
        {    0x0111, ifd0Id,           newTiffImageData<0x0117, ifd0Id>          },
 
1239
        {    0x0117, ifd0Id,           newTiffImageSize<0x0111, ifd0Id>          },
 
1240
        {    0x0144, ifd0Id,           newTiffImageData<0x0145, ifd0Id>          },
 
1241
        {    0x0145, ifd0Id,           newTiffImageSize<0x0144, ifd0Id>          },
 
1242
        {    0x0201, ifd0Id,           newTiffImageData<0x0202, ifd0Id>          },
 
1243
        {    0x0202, ifd0Id,           newTiffImageSize<0x0201, ifd0Id>          },
 
1244
        {    0x014a, ifd0Id,           newTiffSubIfd<subImage1Id>                },
 
1245
        { Tag::next, ifd0Id,           newTiffDirectory<ifd1Id>                  },
 
1246
        {  Tag::all, ifd0Id,           newTiffEntry                              },
 
1247
 
 
1248
        // Subdir subImage1
 
1249
        {    0x0111, subImage1Id,      newTiffImageData<0x0117, subImage1Id>     },
 
1250
        {    0x0117, subImage1Id,      newTiffImageSize<0x0111, subImage1Id>     },
 
1251
        {    0x0144, subImage1Id,      newTiffImageData<0x0145, subImage1Id>     },
 
1252
        {    0x0145, subImage1Id,      newTiffImageSize<0x0144, subImage1Id>     },
 
1253
        {    0x0201, subImage1Id,      newTiffImageData<0x0202, subImage1Id>     },
 
1254
        {    0x0202, subImage1Id,      newTiffImageSize<0x0201, subImage1Id>     },
 
1255
        { Tag::next, subImage1Id,      newTiffDirectory<ignoreId>                },
 
1256
        {  Tag::all, subImage1Id,      newTiffEntry                              },
 
1257
 
 
1258
        // Subdir subImage2
 
1259
        {    0x0111, subImage2Id,      newTiffImageData<0x0117, subImage2Id>     },
 
1260
        {    0x0117, subImage2Id,      newTiffImageSize<0x0111, subImage2Id>     },
 
1261
        {    0x0144, subImage2Id,      newTiffImageData<0x0145, subImage2Id>     },
 
1262
        {    0x0145, subImage2Id,      newTiffImageSize<0x0144, subImage2Id>     },
 
1263
        {    0x0201, subImage2Id,      newTiffImageData<0x0202, subImage2Id>     },
 
1264
        {    0x0202, subImage2Id,      newTiffImageSize<0x0201, subImage2Id>     },
 
1265
        { Tag::next, subImage2Id,      newTiffDirectory<ignoreId>                },
 
1266
        {  Tag::all, subImage2Id,      newTiffEntry                              },
 
1267
 
 
1268
        // Subdir subImage3
 
1269
        {    0x0111, subImage3Id,      newTiffImageData<0x0117, subImage3Id>     },
 
1270
        {    0x0117, subImage3Id,      newTiffImageSize<0x0111, subImage3Id>     },
 
1271
        {    0x0144, subImage3Id,      newTiffImageData<0x0145, subImage3Id>     },
 
1272
        {    0x0145, subImage3Id,      newTiffImageSize<0x0144, subImage3Id>     },
 
1273
        {    0x0201, subImage3Id,      newTiffImageData<0x0202, subImage3Id>     },
 
1274
        {    0x0202, subImage3Id,      newTiffImageSize<0x0201, subImage3Id>     },
 
1275
        { Tag::next, subImage3Id,      newTiffDirectory<ignoreId>                },
 
1276
        {  Tag::all, subImage3Id,      newTiffEntry                              },
 
1277
 
 
1278
        // Subdir subImage4
 
1279
        {    0x0111, subImage4Id,      newTiffImageData<0x0117, subImage4Id>     },
 
1280
        {    0x0117, subImage4Id,      newTiffImageSize<0x0111, subImage4Id>     },
 
1281
        {    0x0144, subImage4Id,      newTiffImageData<0x0145, subImage4Id>     },
 
1282
        {    0x0145, subImage4Id,      newTiffImageSize<0x0144, subImage4Id>     },
 
1283
        {    0x0201, subImage4Id,      newTiffImageData<0x0202, subImage4Id>     },
 
1284
        {    0x0202, subImage4Id,      newTiffImageSize<0x0201, subImage4Id>     },
 
1285
        { Tag::next, subImage4Id,      newTiffDirectory<ignoreId>                },
 
1286
        {  Tag::all, subImage4Id,      newTiffEntry                              },
 
1287
 
 
1288
        // Subdir subImage5
 
1289
        {    0x0111, subImage5Id,      newTiffImageData<0x0117, subImage5Id>     },
 
1290
        {    0x0117, subImage5Id,      newTiffImageSize<0x0111, subImage5Id>     },
 
1291
        {    0x0144, subImage5Id,      newTiffImageData<0x0145, subImage5Id>     },
 
1292
        {    0x0145, subImage5Id,      newTiffImageSize<0x0144, subImage5Id>     },
 
1293
        {    0x0201, subImage5Id,      newTiffImageData<0x0202, subImage5Id>     },
 
1294
        {    0x0202, subImage5Id,      newTiffImageSize<0x0201, subImage5Id>     },
 
1295
        { Tag::next, subImage5Id,      newTiffDirectory<ignoreId>                },
 
1296
        {  Tag::all, subImage5Id,      newTiffEntry                              },
 
1297
 
 
1298
        // Subdir subImage6
 
1299
        {    0x0111, subImage6Id,      newTiffImageData<0x0117, subImage6Id>     },
 
1300
        {    0x0117, subImage6Id,      newTiffImageSize<0x0111, subImage6Id>     },
 
1301
        {    0x0144, subImage6Id,      newTiffImageData<0x0145, subImage6Id>     },
 
1302
        {    0x0145, subImage6Id,      newTiffImageSize<0x0144, subImage6Id>     },
 
1303
        {    0x0201, subImage6Id,      newTiffImageData<0x0202, subImage6Id>     },
 
1304
        {    0x0202, subImage6Id,      newTiffImageSize<0x0201, subImage6Id>     },
 
1305
        { Tag::next, subImage6Id,      newTiffDirectory<ignoreId>                },
 
1306
        {  Tag::all, subImage6Id,      newTiffEntry                              },
 
1307
 
 
1308
        // Subdir subImage7
 
1309
        {    0x0111, subImage7Id,      newTiffImageData<0x0117, subImage7Id>     },
 
1310
        {    0x0117, subImage7Id,      newTiffImageSize<0x0111, subImage7Id>     },
 
1311
        {    0x0144, subImage7Id,      newTiffImageData<0x0145, subImage7Id>     },
 
1312
        {    0x0145, subImage7Id,      newTiffImageSize<0x0144, subImage7Id>     },
 
1313
        {    0x0201, subImage7Id,      newTiffImageData<0x0202, subImage7Id>     },
 
1314
        {    0x0202, subImage7Id,      newTiffImageSize<0x0201, subImage7Id>     },
 
1315
        { Tag::next, subImage7Id,      newTiffDirectory<ignoreId>                },
 
1316
        {  Tag::all, subImage7Id,      newTiffEntry                              },
 
1317
 
 
1318
        // Subdir subImage8
 
1319
        {    0x0111, subImage8Id,      newTiffImageData<0x0117, subImage8Id>     },
 
1320
        {    0x0117, subImage8Id,      newTiffImageSize<0x0111, subImage8Id>     },
 
1321
        {    0x0144, subImage8Id,      newTiffImageData<0x0145, subImage8Id>     },
 
1322
        {    0x0145, subImage8Id,      newTiffImageSize<0x0144, subImage8Id>     },
 
1323
        {    0x0201, subImage8Id,      newTiffImageData<0x0202, subImage8Id>     },
 
1324
        {    0x0202, subImage8Id,      newTiffImageSize<0x0201, subImage8Id>     },
 
1325
        { Tag::next, subImage8Id,      newTiffDirectory<ignoreId>                },
 
1326
        {  Tag::all, subImage8Id,      newTiffEntry                              },
 
1327
 
 
1328
        // Subdir subImage9
 
1329
        {    0x0111, subImage9Id,      newTiffImageData<0x0117, subImage9Id>     },
 
1330
        {    0x0117, subImage9Id,      newTiffImageSize<0x0111, subImage9Id>     },
 
1331
        {    0x0144, subImage9Id,      newTiffImageData<0x0145, subImage9Id>     },
 
1332
        {    0x0145, subImage9Id,      newTiffImageSize<0x0144, subImage9Id>     },
 
1333
        {    0x0201, subImage9Id,      newTiffImageData<0x0202, subImage9Id>     },
 
1334
        {    0x0202, subImage9Id,      newTiffImageSize<0x0201, subImage9Id>     },
 
1335
        { Tag::next, subImage9Id,      newTiffDirectory<ignoreId>                },
 
1336
        {  Tag::all, subImage9Id,      newTiffEntry                              },
1291
1337
 
1292
1338
        // Exif subdir
1293
 
        {    0xa005, Group::exif,      newTiffSubIfd<Group::iop>                 },
1294
 
        {    0x927c, Group::exif,      newTiffMnEntry                            },
1295
 
        { Tag::next, Group::exif,      newTiffDirectory<Group::ignr>             },
1296
 
        {  Tag::all, Group::exif,      newTiffEntry                              },
 
1339
        {    0xa005, exifId,           newTiffSubIfd<iopId>                      },
 
1340
        {    0x927c, exifId,           newTiffMnEntry                            },
 
1341
        { Tag::next, exifId,           newTiffDirectory<ignoreId>                },
 
1342
        {  Tag::all, exifId,           newTiffEntry                              },
1297
1343
 
1298
1344
        // GPS subdir
1299
 
        { Tag::next, Group::gps,       newTiffDirectory<Group::ignr>             },
1300
 
        {  Tag::all, Group::gps,       newTiffEntry                              },
 
1345
        { Tag::next, gpsId,            newTiffDirectory<ignoreId>                },
 
1346
        {  Tag::all, gpsId,            newTiffEntry                              },
1301
1347
 
1302
1348
        // IOP subdir
1303
 
        { Tag::next, Group::iop,       newTiffDirectory<Group::ignr>             },
1304
 
        {  Tag::all, Group::iop,       newTiffEntry                              },
 
1349
        { Tag::next, iopId,            newTiffDirectory<ignoreId>                },
 
1350
        {  Tag::all, iopId,            newTiffEntry                              },
1305
1351
 
1306
1352
        // IFD1
1307
 
        {    0x0111, Group::ifd1,      newTiffThumbData<0x0117, Group::ifd1>     },
1308
 
        {    0x0117, Group::ifd1,      newTiffThumbSize<0x0111, Group::ifd1>     },
1309
 
        {    0x0144, Group::ifd1,      newTiffImageData<0x0145, Group::ifd1>     },
1310
 
        {    0x0145, Group::ifd1,      newTiffImageSize<0x0144, Group::ifd1>     },
1311
 
        {    0x0201, Group::ifd1,      newTiffThumbData<0x0202, Group::ifd1>     },
1312
 
        {    0x0202, Group::ifd1,      newTiffThumbSize<0x0201, Group::ifd1>     },
1313
 
        { Tag::next, Group::ifd1,      newTiffDirectory<Group::ifd2>             },
1314
 
        {  Tag::all, Group::ifd1,      newTiffEntry                              },
 
1353
        {    0x0111, ifd1Id,           newTiffThumbData<0x0117, ifd1Id>          },
 
1354
        {    0x0117, ifd1Id,           newTiffThumbSize<0x0111, ifd1Id>          },
 
1355
        {    0x0144, ifd1Id,           newTiffImageData<0x0145, ifd1Id>          },
 
1356
        {    0x0145, ifd1Id,           newTiffImageSize<0x0144, ifd1Id>          },
 
1357
        {    0x014a, ifd1Id,           newTiffSubIfd<subThumb1Id>                },
 
1358
        {    0x0201, ifd1Id,           newTiffThumbData<0x0202, ifd1Id>          },
 
1359
        {    0x0202, ifd1Id,           newTiffThumbSize<0x0201, ifd1Id>          },
 
1360
        { Tag::next, ifd1Id,           newTiffDirectory<ifd2Id>                  },
 
1361
        {  Tag::all, ifd1Id,           newTiffEntry                              },
 
1362
 
 
1363
        // Subdir subThumb1
 
1364
        {    0x0111, subThumb1Id,      newTiffImageData<0x0117, subThumb1Id>     },
 
1365
        {    0x0117, subThumb1Id,      newTiffImageSize<0x0111, subThumb1Id>     },
 
1366
        {    0x0144, subThumb1Id,      newTiffImageData<0x0145, subThumb1Id>     },
 
1367
        {    0x0145, subThumb1Id,      newTiffImageSize<0x0144, subThumb1Id>     },
 
1368
        {    0x0201, subThumb1Id,      newTiffImageData<0x0202, subThumb1Id>     },
 
1369
        {    0x0202, subThumb1Id,      newTiffImageSize<0x0201, subThumb1Id>     },
 
1370
        { Tag::next, subThumb1Id,      newTiffDirectory<ignoreId>                },
 
1371
        {  Tag::all, subThumb1Id,      newTiffEntry                              },
1315
1372
 
1316
1373
        // IFD2 (eg, in Pentax PEF and Canon CR2 files)
1317
 
        {    0x0111, Group::ifd2,      newTiffImageData<0x0117, Group::ifd2>     },
1318
 
        {    0x0117, Group::ifd2,      newTiffImageSize<0x0111, Group::ifd2>     },
1319
 
        {    0x0144, Group::ifd1,      newTiffImageData<0x0145, Group::ifd2>     },
1320
 
        {    0x0145, Group::ifd1,      newTiffImageSize<0x0144, Group::ifd2>     },
1321
 
        {    0x0201, Group::ifd2,      newTiffImageData<0x0202, Group::ifd2>     },
1322
 
        {    0x0202, Group::ifd2,      newTiffImageSize<0x0201, Group::ifd2>     },
1323
 
        { Tag::next, Group::ifd2,      newTiffDirectory<Group::ifd3>             },
1324
 
        {  Tag::all, Group::ifd2,      newTiffEntry                              },
 
1374
        {    0x0111, ifd2Id,           newTiffImageData<0x0117, ifd2Id>          },
 
1375
        {    0x0117, ifd2Id,           newTiffImageSize<0x0111, ifd2Id>          },
 
1376
        {    0x0144, ifd1Id,           newTiffImageData<0x0145, ifd2Id>          },
 
1377
        {    0x0145, ifd1Id,           newTiffImageSize<0x0144, ifd2Id>          },
 
1378
        {    0x0201, ifd2Id,           newTiffImageData<0x0202, ifd2Id>          },
 
1379
        {    0x0202, ifd2Id,           newTiffImageSize<0x0201, ifd2Id>          },
 
1380
        { Tag::next, ifd2Id,           newTiffDirectory<ifd3Id>                  },
 
1381
        {  Tag::all, ifd2Id,           newTiffEntry                              },
1325
1382
 
1326
1383
        // IFD3 (eg, in Canon CR2 files)
1327
 
        {    0x0111, Group::ifd3,      newTiffImageData<0x0117, Group::ifd3>     },
1328
 
        {    0x0117, Group::ifd3,      newTiffImageSize<0x0111, Group::ifd3>     },
1329
 
        {    0x0144, Group::ifd1,      newTiffImageData<0x0145, Group::ifd3>     },
1330
 
        {    0x0145, Group::ifd1,      newTiffImageSize<0x0144, Group::ifd3>     },
1331
 
        {    0x0201, Group::ifd3,      newTiffImageData<0x0202, Group::ifd3>     },
1332
 
        {    0x0202, Group::ifd3,      newTiffImageSize<0x0201, Group::ifd3>     },
1333
 
        { Tag::next, Group::ifd3,      newTiffDirectory<Group::ignr>             },
1334
 
        {  Tag::all, Group::ifd3,      newTiffEntry                              },
 
1384
        {    0x0111, ifd3Id,           newTiffImageData<0x0117, ifd3Id>          },
 
1385
        {    0x0117, ifd3Id,           newTiffImageSize<0x0111, ifd3Id>          },
 
1386
        {    0x0144, ifd1Id,           newTiffImageData<0x0145, ifd3Id>          },
 
1387
        {    0x0145, ifd1Id,           newTiffImageSize<0x0144, ifd3Id>          },
 
1388
        {    0x0201, ifd3Id,           newTiffImageData<0x0202, ifd3Id>          },
 
1389
        {    0x0202, ifd3Id,           newTiffImageSize<0x0201, ifd3Id>          },
 
1390
        { Tag::next, ifd3Id,           newTiffDirectory<ignoreId>                },
 
1391
        {  Tag::all, ifd3Id,           newTiffEntry                              },
1335
1392
 
1336
1393
        // Olympus makernote - some Olympus cameras use Minolta structures
1337
1394
        // Todo: Adding such tags will not work (maybe result in a Minolta makernote), need separate groups
1338
 
        {    0x0001, Group::olymp1mn,  EXV_SIMPLE_BINARY_ARRAY(minoCsoCfg)       },
1339
 
        {    0x0003, Group::olymp1mn,  EXV_SIMPLE_BINARY_ARRAY(minoCsnCfg)       },
1340
 
        { Tag::next, Group::olymp1mn,  newTiffDirectory<Group::ignr>             },
1341
 
        {  Tag::all, Group::olymp1mn,  newTiffEntry                              },
 
1395
        {    0x0001, olympusId,        EXV_SIMPLE_BINARY_ARRAY(minoCsoCfg)       },
 
1396
        {    0x0003, olympusId,        EXV_SIMPLE_BINARY_ARRAY(minoCsnCfg)       },
 
1397
        { Tag::next, olympusId,        newTiffDirectory<ignoreId>                },
 
1398
        {  Tag::all, olympusId,        newTiffEntry                              },
1342
1399
 
1343
1400
        // Olympus2 makernote
1344
 
        {    0x0001, Group::olymp2mn,  EXV_SIMPLE_BINARY_ARRAY(minoCsoCfg)       },
1345
 
        {    0x0003, Group::olymp2mn,  EXV_SIMPLE_BINARY_ARRAY(minoCsnCfg)       },
1346
 
        {    0x2010, Group::olymp2mn,  newTiffSubIfd<Group::olympeq>             },
1347
 
        {    0x2020, Group::olymp2mn,  newTiffSubIfd<Group::olympcs>             },
1348
 
        {    0x2030, Group::olymp2mn,  newTiffSubIfd<Group::olymprd>             },
1349
 
        {    0x2031, Group::olymp2mn,  newTiffSubIfd<Group::olymprd2>            },
1350
 
        {    0x2040, Group::olymp2mn,  newTiffSubIfd<Group::olympip>             },
1351
 
        {    0x2050, Group::olymp2mn,  newTiffSubIfd<Group::olympfi>             },
1352
 
        {    0x2100, Group::olymp2mn,  newTiffSubIfd<Group::olympfe1>            },
1353
 
        {    0x2200, Group::olymp2mn,  newTiffSubIfd<Group::olympfe2>            },
1354
 
        {    0x2300, Group::olymp2mn,  newTiffSubIfd<Group::olympfe3>            },
1355
 
        {    0x2400, Group::olymp2mn,  newTiffSubIfd<Group::olympfe4>            },
1356
 
        {    0x2500, Group::olymp2mn,  newTiffSubIfd<Group::olympfe5>            },
1357
 
        {    0x2600, Group::olymp2mn,  newTiffSubIfd<Group::olympfe6>            },
1358
 
        {    0x2700, Group::olymp2mn,  newTiffSubIfd<Group::olympfe7>            },
1359
 
        {    0x2800, Group::olymp2mn,  newTiffSubIfd<Group::olympfe8>            },
1360
 
        {    0x2900, Group::olymp2mn,  newTiffSubIfd<Group::olympfe9>            },
1361
 
        {    0x3000, Group::olymp2mn,  newTiffSubIfd<Group::olympri>             },
1362
 
        { Tag::next, Group::olymp2mn,  newTiffDirectory<Group::ignr>             },
1363
 
        {  Tag::all, Group::olymp2mn,  newTiffEntry                              },
 
1401
        {    0x0001, olympus2Id,       EXV_SIMPLE_BINARY_ARRAY(minoCsoCfg)       },
 
1402
        {    0x0003, olympus2Id,       EXV_SIMPLE_BINARY_ARRAY(minoCsnCfg)       },
 
1403
        {    0x2010, olympus2Id,       newTiffSubIfd<olympusEqId>                },
 
1404
        {    0x2020, olympus2Id,       newTiffSubIfd<olympusCsId>                },
 
1405
        {    0x2030, olympus2Id,       newTiffSubIfd<olympusRdId>                },
 
1406
        {    0x2031, olympus2Id,       newTiffSubIfd<olympusRd2Id>               },
 
1407
        {    0x2040, olympus2Id,       newTiffSubIfd<olympusIpId>                },
 
1408
        {    0x2050, olympus2Id,       newTiffSubIfd<olympusFiId>                },
 
1409
        {    0x2100, olympus2Id,       newTiffSubIfd<olympusFe1Id>               },
 
1410
        {    0x2200, olympus2Id,       newTiffSubIfd<olympusFe2Id>               },
 
1411
        {    0x2300, olympus2Id,       newTiffSubIfd<olympusFe3Id>               },
 
1412
        {    0x2400, olympus2Id,       newTiffSubIfd<olympusFe4Id>               },
 
1413
        {    0x2500, olympus2Id,       newTiffSubIfd<olympusFe5Id>               },
 
1414
        {    0x2600, olympus2Id,       newTiffSubIfd<olympusFe6Id>               },
 
1415
        {    0x2700, olympus2Id,       newTiffSubIfd<olympusFe7Id>               },
 
1416
        {    0x2800, olympus2Id,       newTiffSubIfd<olympusFe8Id>               },
 
1417
        {    0x2900, olympus2Id,       newTiffSubIfd<olympusFe9Id>               },
 
1418
        {    0x3000, olympus2Id,       newTiffSubIfd<olympusRiId>                },
 
1419
        { Tag::next, olympus2Id,       newTiffDirectory<ignoreId>                },
 
1420
        {  Tag::all, olympus2Id,       newTiffEntry                              },
1364
1421
 
1365
1422
        // Olympus2 equipment subdir
1366
 
        {  Tag::all, Group::olympeq,   newTiffEntry                              },
 
1423
        {  Tag::all, olympusEqId,        newTiffEntry                            },
1367
1424
 
1368
1425
        // Olympus2 camera settings subdir
1369
 
        {    0x0101, Group::olympcs,   newTiffImageData<0x0102, Group::olympcs>  },
1370
 
        {    0x0102, Group::olympcs,   newTiffImageSize<0x0101, Group::olympcs>  },
1371
 
        {  Tag::all, Group::olympcs,   newTiffEntry                              },
 
1426
        {    0x0101, olympusCsId,        newTiffImageData<0x0102, olympusCsId>   },
 
1427
        {    0x0102, olympusCsId,        newTiffImageSize<0x0101, olympusCsId>   },
 
1428
        {  Tag::all, olympusCsId,        newTiffEntry                            },
1372
1429
 
1373
1430
        // Olympus2 raw development subdir
1374
 
        {  Tag::all, Group::olymprd,   newTiffEntry                              },
 
1431
        {  Tag::all, olympusRdId,        newTiffEntry                            },
1375
1432
 
1376
1433
        // Olympus2 raw development 2 subdir
1377
 
        {  Tag::all, Group::olymprd2,  newTiffEntry                              },
 
1434
        {  Tag::all, olympusRd2Id,       newTiffEntry                            },
1378
1435
 
1379
1436
        // Olympus2 image processing subdir
1380
 
        {  Tag::all, Group::olympip,   newTiffEntry                              },
 
1437
        {  Tag::all, olympusIpId,        newTiffEntry                            },
1381
1438
 
1382
1439
        // Olympus2 focus info subdir
1383
 
        {  Tag::all, Group::olympfi,   newTiffEntry                              },
 
1440
        {  Tag::all, olympusFiId,        newTiffEntry                            },
1384
1441
 
1385
1442
        // Olympus2 FE 1 subdir
1386
 
        {  Tag::all, Group::olympfe1,  newTiffEntry                              },
 
1443
        {  Tag::all, olympusFe1Id,       newTiffEntry                            },
1387
1444
 
1388
1445
        // Olympus2 FE 2 subdir
1389
 
        {  Tag::all, Group::olympfe2,  newTiffEntry                              },
 
1446
        {  Tag::all, olympusFe2Id,       newTiffEntry                            },
1390
1447
 
1391
1448
        // Olympus2 FE 3 subdir
1392
 
        {  Tag::all, Group::olympfe3,  newTiffEntry                              },
 
1449
        {  Tag::all, olympusFe3Id,       newTiffEntry                            },
1393
1450
 
1394
1451
        // Olympus2 FE 4 subdir
1395
 
        {  Tag::all, Group::olympfe4,  newTiffEntry                              },
 
1452
        {  Tag::all, olympusFe4Id,       newTiffEntry                            },
1396
1453
 
1397
1454
        // Olympus2 FE 5 subdir
1398
 
        {  Tag::all, Group::olympfe5,  newTiffEntry                              },
 
1455
        {  Tag::all, olympusFe5Id,       newTiffEntry                            },
1399
1456
 
1400
1457
        // Olympus2 FE 6 subdir
1401
 
        {  Tag::all, Group::olympfe6,  newTiffEntry                              },
 
1458
        {  Tag::all, olympusFe6Id,       newTiffEntry                            },
1402
1459
 
1403
1460
        // Olympus2 FE 7 subdir
1404
 
        {  Tag::all, Group::olympfe7,  newTiffEntry                              },
 
1461
        {  Tag::all, olympusFe7Id,       newTiffEntry                            },
1405
1462
 
1406
1463
        // Olympus2 FE 8 subdir
1407
 
        {  Tag::all, Group::olympfe8,  newTiffEntry                              },
 
1464
        {  Tag::all, olympusFe8Id,       newTiffEntry                            },
1408
1465
 
1409
1466
        // Olympus2 FE 9 subdir
1410
 
        {  Tag::all, Group::olympfe9,  newTiffEntry                              },
 
1467
        {  Tag::all, olympusFe9Id,       newTiffEntry                            },
1411
1468
 
1412
1469
        // Olympus2 Raw Info subdir
1413
 
        {  Tag::all, Group::olympri,   newTiffEntry                              },
 
1470
        {  Tag::all, olympusRiId,        newTiffEntry                            },
1414
1471
 
1415
1472
        // Fujifilm makernote
1416
 
        { Tag::next, Group::fujimn,    newTiffDirectory<Group::ignr>             },
1417
 
        {  Tag::all, Group::fujimn,    newTiffEntry                              },
 
1473
        { Tag::next, fujiId,           newTiffDirectory<ignoreId>                },
 
1474
        {  Tag::all, fujiId,           newTiffEntry                              },
1418
1475
 
1419
1476
        // Canon makernote
1420
 
        {    0x0001, Group::canonmn,   EXV_BINARY_ARRAY(canonCsCfg, canonCsDef)  },
1421
 
        {    0x0004, Group::canonmn,   EXV_SIMPLE_BINARY_ARRAY(canonSiCfg)       },
1422
 
        {    0x0005, Group::canonmn,   EXV_SIMPLE_BINARY_ARRAY(canonPaCfg)       },
1423
 
        {    0x000f, Group::canonmn,   EXV_SIMPLE_BINARY_ARRAY(canonCfCfg)       },
1424
 
        {    0x0012, Group::canonmn,   EXV_SIMPLE_BINARY_ARRAY(canonPiCfg)       },
1425
 
        {    0x0093, Group::canonmn,   EXV_BINARY_ARRAY(canonFiCfg, canonFiDef)  },
1426
 
        { Tag::next, Group::canonmn,   newTiffDirectory<Group::ignr>             },
1427
 
        {  Tag::all, Group::canonmn,   newTiffEntry                              },
 
1477
        {    0x0001, canonId,          EXV_BINARY_ARRAY(canonCsCfg, canonCsDef)  },
 
1478
        {    0x0004, canonId,          EXV_SIMPLE_BINARY_ARRAY(canonSiCfg)       },
 
1479
        {    0x0005, canonId,          EXV_SIMPLE_BINARY_ARRAY(canonPaCfg)       },
 
1480
        {    0x000f, canonId,          EXV_SIMPLE_BINARY_ARRAY(canonCfCfg)       },
 
1481
        {    0x0012, canonId,          EXV_SIMPLE_BINARY_ARRAY(canonPiCfg)       },
 
1482
        {    0x0093, canonId,          EXV_BINARY_ARRAY(canonFiCfg, canonFiDef)  },
 
1483
        {    0x00a0, canonId,          EXV_SIMPLE_BINARY_ARRAY(canonPrCfg)  },
 
1484
        { Tag::next, canonId,          newTiffDirectory<ignoreId>                },
 
1485
        {  Tag::all, canonId,          newTiffEntry                              },
1428
1486
 
1429
1487
        // Canon makernote composite tags
1430
 
        {  Tag::all, Group::canoncs,   newTiffBinaryElement                      },
1431
 
        {  Tag::all, Group::canonsi,   newTiffBinaryElement                      },
1432
 
        {  Tag::all, Group::canonpa,   newTiffBinaryElement                      },
1433
 
        {  Tag::all, Group::canoncf,   newTiffBinaryElement                      },
1434
 
        {  Tag::all, Group::canonpi,   newTiffBinaryElement                      },
1435
 
        {  Tag::all, Group::canonfi,   newTiffBinaryElement                      },
 
1488
        {  Tag::all, canonCsId,        newTiffBinaryElement                      },
 
1489
        {  Tag::all, canonSiId,        newTiffBinaryElement                      },
 
1490
        {  Tag::all, canonPaId,        newTiffBinaryElement                      },
 
1491
        {  Tag::all, canonCfId,        newTiffBinaryElement                      },
 
1492
        {  Tag::all, canonPiId,        newTiffBinaryElement                      },
 
1493
        {  Tag::all, canonFiId,        newTiffBinaryElement                      },
 
1494
        {  Tag::all, canonPrId,        newTiffBinaryElement                      },
1436
1495
 
1437
1496
        // Nikon1 makernote
1438
 
        { Tag::next, Group::nikon1mn,  newTiffDirectory<Group::ignr>             },
1439
 
        {  Tag::all, Group::nikon1mn,  newTiffEntry                              },
 
1497
        { Tag::next, nikon1Id,         newTiffDirectory<ignoreId>                },
 
1498
        {  Tag::all, nikon1Id,         newTiffEntry                              },
1440
1499
 
1441
1500
        // Nikon2 makernote
1442
 
        { Tag::next, Group::nikon2mn,  newTiffDirectory<Group::ignr>             },
1443
 
        {  Tag::all, Group::nikon2mn,  newTiffEntry                              },
 
1501
        { Tag::next, nikon2Id,         newTiffDirectory<ignoreId>                },
 
1502
        {  Tag::all, nikon2Id,         newTiffEntry                              },
1444
1503
 
1445
1504
        // Nikon3 makernote
1446
 
        { Tag::next, Group::nikon3mn,  newTiffDirectory<Group::ignr>             },
1447
 
        {    0x0011, Group::nikon3mn,  newTiffSubIfd<Group::nikonpv>             },
1448
 
        {    0x001f, Group::nikon3mn,  EXV_BINARY_ARRAY(nikonVrCfg, nikonVrDef)  },
1449
 
        {    0x0023, Group::nikon3mn,  EXV_BINARY_ARRAY(nikonPcCfg, nikonPcDef)  },
1450
 
        {    0x0024, Group::nikon3mn,  EXV_BINARY_ARRAY(nikonWtCfg, nikonWtDef)  },
1451
 
        {    0x0025, Group::nikon3mn,  EXV_BINARY_ARRAY(nikonIiCfg, nikonIiDef)  },
1452
 
        {    0x0088, Group::nikon3mn,  EXV_BINARY_ARRAY(nikonAfCfg, nikonAfDef)  },
1453
 
        {    0x0091, Group::nikon3mn,  EXV_COMPLEX_BINARY_ARRAY(nikonSiSet, nikonSelector) },
1454
 
        {    0x0097, Group::nikon3mn,  EXV_COMPLEX_BINARY_ARRAY(nikonCbSet, nikonSelector) },
1455
 
        {    0x0098, Group::nikon3mn,  EXV_COMPLEX_BINARY_ARRAY(nikonLdSet, nikonSelector) },
1456
 
        {    0x00a8, Group::nikon3mn,  EXV_COMPLEX_BINARY_ARRAY(nikonFlSet, nikonSelector) },
1457
 
        {    0x00b0, Group::nikon3mn,  EXV_BINARY_ARRAY(nikonMeCfg, nikonMeDef)  },
1458
 
        {    0x00b7, Group::nikon3mn,  EXV_BINARY_ARRAY(nikonAf2Cfg, nikonAf2Def) },
1459
 
        {    0x00b8, Group::nikon3mn,  EXV_BINARY_ARRAY(nikonFiCfg, nikonFiDef)  },
1460
 
        {  Tag::all, Group::nikon3mn,  newTiffEntry                              },
 
1505
        { Tag::next, nikon3Id,         newTiffDirectory<ignoreId>                },
 
1506
        {    0x0011, nikon3Id,         newTiffSubIfd<nikonPvId>                  },
 
1507
        {    0x001f, nikon3Id,         EXV_BINARY_ARRAY(nikonVrCfg, nikonVrDef)  },
 
1508
        {    0x0023, nikon3Id,         EXV_BINARY_ARRAY(nikonPcCfg, nikonPcDef)  },
 
1509
        {    0x0024, nikon3Id,         EXV_BINARY_ARRAY(nikonWtCfg, nikonWtDef)  },
 
1510
        {    0x0025, nikon3Id,         EXV_BINARY_ARRAY(nikonIiCfg, nikonIiDef)  },
 
1511
        {    0x0088, nikon3Id,         EXV_BINARY_ARRAY(nikonAfCfg, nikonAfDef)  },
 
1512
        {    0x0091, nikon3Id,         EXV_COMPLEX_BINARY_ARRAY(nikonSiSet, nikonSelector) },
 
1513
        {    0x0097, nikon3Id,         EXV_COMPLEX_BINARY_ARRAY(nikonCbSet, nikonSelector) },
 
1514
        {    0x0098, nikon3Id,         EXV_COMPLEX_BINARY_ARRAY(nikonLdSet, nikonSelector) },
 
1515
        {    0x00a8, nikon3Id,         EXV_COMPLEX_BINARY_ARRAY(nikonFlSet, nikonSelector) },
 
1516
        {    0x00b0, nikon3Id,         EXV_BINARY_ARRAY(nikonMeCfg, nikonMeDef)  },
 
1517
        {    0x00b7, nikon3Id,         EXV_BINARY_ARRAY(nikonAf2Cfg, nikonAf2Def)},
 
1518
        {    0x00b8, nikon3Id,         EXV_BINARY_ARRAY(nikonFiCfg, nikonFiDef)  },
 
1519
        {  Tag::all, nikon3Id,         newTiffEntry                              },
1461
1520
 
1462
1521
        // Nikon3 makernote preview subdir
1463
 
        {    0x0201, Group::nikonpv,   newTiffThumbData<0x0202, Group::nikonpv>  },
1464
 
        {    0x0202, Group::nikonpv,   newTiffThumbSize<0x0201, Group::nikonpv>  },
1465
 
        { Tag::next, Group::nikonpv,   newTiffDirectory<Group::ignr>             },
1466
 
        {  Tag::all, Group::nikonpv,   newTiffEntry                              },
 
1522
        {    0x0201, nikonPvId,        newTiffThumbData<0x0202, nikonPvId>       },
 
1523
        {    0x0202, nikonPvId,        newTiffThumbSize<0x0201, nikonPvId>       },
 
1524
        { Tag::next, nikonPvId,        newTiffDirectory<ignoreId>                },
 
1525
        {  Tag::all, nikonPvId,        newTiffEntry                              },
1467
1526
 
1468
1527
        // Nikon3 vibration reduction
1469
 
        {  Tag::all, Group::nikonvr,   newTiffBinaryElement                      },
 
1528
        {  Tag::all, nikonVrId,        newTiffBinaryElement                      },
1470
1529
 
1471
1530
        // Nikon3 picture control
1472
 
        {  Tag::all, Group::nikonpc,   newTiffBinaryElement                      },
 
1531
        {  Tag::all, nikonPcId,        newTiffBinaryElement                      },
1473
1532
 
1474
1533
        // Nikon3 world time
1475
 
        {  Tag::all, Group::nikonwt,   newTiffBinaryElement                      },
 
1534
        {  Tag::all, nikonWtId,        newTiffBinaryElement                      },
1476
1535
 
1477
1536
        // Nikon3 ISO info
1478
 
        {  Tag::all, Group::nikonii,   newTiffBinaryElement                      },
 
1537
        {  Tag::all, nikonIiId,        newTiffBinaryElement                      },
1479
1538
 
1480
1539
        // Nikon3 auto focus
1481
 
        {  Tag::all, Group::nikonaf,   newTiffBinaryElement                      },
 
1540
        {  Tag::all, nikonAfId,        newTiffBinaryElement                      },
1482
1541
        
1483
1542
        // Nikon3 auto focus 2
1484
 
        {  Tag::all, Group::nikonaf2,  newTiffBinaryElement                      },
 
1543
        {  Tag::all, nikonAf2Id,       newTiffBinaryElement                      },
1485
1544
        
1486
1545
        // Nikon3 file info
1487
 
        {  Tag::all, Group::nikonfi,   newTiffBinaryElement                      },
 
1546
        {  Tag::all, nikonFiId,        newTiffBinaryElement                      },
1488
1547
 
1489
1548
        // Nikon3 multi exposure
1490
 
        {  Tag::all, Group::nikonme,   newTiffBinaryElement                      },
 
1549
        {  Tag::all, nikonMeId,        newTiffBinaryElement                      },
1491
1550
 
1492
1551
        // Nikon3 flash info
1493
 
        {  Tag::all, Group::nikonfl1,  newTiffBinaryElement                      },
1494
 
        {  Tag::all, Group::nikonfl2,  newTiffBinaryElement                      },
1495
 
        {  Tag::all, Group::nikonfl3,  newTiffBinaryElement                      },
 
1552
        {  Tag::all, nikonFl1Id,       newTiffBinaryElement                      },
 
1553
        {  Tag::all, nikonFl2Id,       newTiffBinaryElement                      },
 
1554
        {  Tag::all, nikonFl3Id,       newTiffBinaryElement                      },
1496
1555
 
1497
1556
        // Nikon3 shot info
1498
 
        {  Tag::all, Group::nikonsi1,  newTiffBinaryElement                      },
1499
 
        {  Tag::all, Group::nikonsi2,  newTiffBinaryElement                      },
1500
 
        {  Tag::all, Group::nikonsi3,  newTiffBinaryElement                      },
1501
 
        {  Tag::all, Group::nikonsi4,  newTiffBinaryElement                      },
1502
 
        {  Tag::all, Group::nikonsi5,  newTiffBinaryElement                      },
1503
 
        {  Tag::all, Group::nikonsi6,  newTiffBinaryElement                      },
 
1557
        {  Tag::all, nikonSi1Id,       newTiffBinaryElement                      },
 
1558
        {  Tag::all, nikonSi2Id,       newTiffBinaryElement                      },
 
1559
        {  Tag::all, nikonSi3Id,       newTiffBinaryElement                      },
 
1560
        {  Tag::all, nikonSi4Id,       newTiffBinaryElement                      },
 
1561
        {  Tag::all, nikonSi5Id,       newTiffBinaryElement                      },
 
1562
        {  Tag::all, nikonSi6Id,       newTiffBinaryElement                      },
1504
1563
 
1505
1564
        // Nikon3 color balance
1506
 
        {  Tag::all, Group::nikoncb1,  newTiffBinaryElement                      },
1507
 
        {  Tag::all, Group::nikoncb2,  newTiffBinaryElement                      },
1508
 
        {  Tag::all, Group::nikoncb2a, newTiffBinaryElement                      },
1509
 
        {  Tag::all, Group::nikoncb2b, newTiffBinaryElement                      },
1510
 
        {  Tag::all, Group::nikoncb3,  newTiffBinaryElement                      },
1511
 
        {  Tag::all, Group::nikoncb4,  newTiffBinaryElement                      },
 
1565
        {  Tag::all, nikonCb1Id,       newTiffBinaryElement                      },
 
1566
        {  Tag::all, nikonCb2Id,       newTiffBinaryElement                      },
 
1567
        {  Tag::all, nikonCb2aId,      newTiffBinaryElement                      },
 
1568
        {  Tag::all, nikonCb2bId,      newTiffBinaryElement                      },
 
1569
        {  Tag::all, nikonCb3Id,       newTiffBinaryElement                      },
 
1570
        {  Tag::all, nikonCb4Id,       newTiffBinaryElement                      },
1512
1571
 
1513
1572
        // Nikon3 lens data
1514
 
        {  Tag::all, Group::nikonld1,  newTiffBinaryElement                      },
1515
 
        {  Tag::all, Group::nikonld2,  newTiffBinaryElement                      },
1516
 
        {  Tag::all, Group::nikonld3,  newTiffBinaryElement                      },
 
1573
        {  Tag::all, nikonLd1Id,       newTiffBinaryElement                      },
 
1574
        {  Tag::all, nikonLd2Id,       newTiffBinaryElement                      },
 
1575
        {  Tag::all, nikonLd3Id,       newTiffBinaryElement                      },
1517
1576
 
1518
1577
        // Panasonic makernote
1519
 
        { Tag::next, Group::panamn,    newTiffDirectory<Group::ignr>             },
1520
 
        {  Tag::all, Group::panamn,    newTiffEntry                              },
 
1578
        { Tag::next, panasonicId,      newTiffDirectory<ignoreId>                },
 
1579
        {  Tag::all, panasonicId,      newTiffEntry                              },
1521
1580
 
1522
1581
        // Pentax makernote
1523
 
        {    0x0003, Group::pentaxmn,  newTiffThumbSize<0x0004, Group::pentaxmn> },
1524
 
        {    0x0004, Group::pentaxmn,  newTiffThumbData<0x0003, Group::pentaxmn> },
1525
 
        { Tag::next, Group::pentaxmn,  newTiffDirectory<Group::ignr>             },
1526
 
        {  Tag::all, Group::pentaxmn,  newTiffEntry                              },
 
1582
        {    0x0003, pentaxId,         newTiffThumbSize<0x0004, pentaxId>        },
 
1583
        {    0x0004, pentaxId,         newTiffThumbData<0x0003, pentaxId>        },
 
1584
        { Tag::next, pentaxId,         newTiffDirectory<ignoreId>                },
 
1585
        {  Tag::all, pentaxId,         newTiffEntry                              },
 
1586
 
 
1587
        // Samsung2 makernote
 
1588
        {    0x0035, samsung2Id,       newTiffSubIfd<samsungPvId>                },
 
1589
        { Tag::next, samsung2Id,       newTiffDirectory<ignoreId>                },
 
1590
        {  Tag::all, samsung2Id,       newTiffEntry                              },
 
1591
 
 
1592
        // Samsung2 makernote preview subdir
 
1593
        {    0x0201, samsungPvId,      newTiffThumbData<0x0202, samsungPvId>     },
 
1594
        {    0x0202, samsungPvId,      newTiffThumbSize<0x0201, samsungPvId>     },
 
1595
        { Tag::next, samsungPvId,      newTiffDirectory<ignoreId>                },
 
1596
        {  Tag::all, samsungPvId,      newTiffEntry                              },
1527
1597
 
1528
1598
        // Sigma/Foveon makernote
1529
 
        { Tag::next, Group::sigmamn,   newTiffDirectory<Group::ignr>             },
1530
 
        {  Tag::all, Group::sigmamn,   newTiffEntry                              },
 
1599
        { Tag::next, sigmaId,          newTiffDirectory<ignoreId>                },
 
1600
        {  Tag::all, sigmaId,          newTiffEntry                              },
1531
1601
 
1532
1602
        // Sony1 makernote
1533
 
        {    0x0114, Group::sony1mn,   EXV_COMPLEX_BINARY_ARRAY(sony1CsSet, sonyCsSelector) },
1534
 
        {    0xb028, Group::sony1mn,   newTiffSubIfd<Group::sonymltmn>           },
1535
 
        { Tag::next, Group::sony1mn,   newTiffDirectory<Group::ignr>             },
1536
 
        {  Tag::all, Group::sony1mn,   newTiffEntry                              },
 
1603
        {    0x0114, sony1Id,          EXV_COMPLEX_BINARY_ARRAY(sony1CsSet, sonyCsSelector) },
 
1604
        {    0xb028, sony1Id,          newTiffSubIfd<sonyMltId>                  },
 
1605
        { Tag::next, sony1Id,          newTiffDirectory<ignoreId>                },
 
1606
        {  Tag::all, sony1Id,          newTiffEntry                              },
1537
1607
 
1538
1608
        // Sony1 camera settings
1539
 
        {  Tag::all, Group::sony1cs,   newTiffBinaryElement                      },
1540
 
        {  Tag::all, Group::sony1cs2,  newTiffBinaryElement                      },
 
1609
        {  Tag::all, sony1CsId,        newTiffBinaryElement                      },
 
1610
        {  Tag::all, sony1Cs2Id,       newTiffBinaryElement                      },
1541
1611
 
1542
1612
        // Sony2 makernote
1543
 
        {    0x0114, Group::sony2mn,   EXV_COMPLEX_BINARY_ARRAY(sony2CsSet, sonyCsSelector) },
1544
 
        { Tag::next, Group::sony2mn,   newTiffDirectory<Group::ignr>             },
1545
 
        {  Tag::all, Group::sony2mn,   newTiffEntry                              },
 
1613
        {    0x0114, sony2Id,          EXV_COMPLEX_BINARY_ARRAY(sony2CsSet, sonyCsSelector) },
 
1614
        { Tag::next, sony2Id,          newTiffDirectory<ignoreId>                },
 
1615
        {  Tag::all, sony2Id,          newTiffEntry                              },
1546
1616
 
1547
1617
        // Sony2 camera settings
1548
 
        {  Tag::all, Group::sony2cs,   newTiffBinaryElement                      },
1549
 
        {  Tag::all, Group::sony2cs2,  newTiffBinaryElement                      },
 
1618
        {  Tag::all, sony2CsId,        newTiffBinaryElement                      },
 
1619
        {  Tag::all, sony2Cs2Id,       newTiffBinaryElement                      },
1550
1620
 
1551
1621
        // Sony1 Minolta makernote
1552
 
        {    0x0001, Group::sonymltmn, EXV_SIMPLE_BINARY_ARRAY(sony1MCsoCfg)     },
1553
 
        {    0x0003, Group::sonymltmn, EXV_SIMPLE_BINARY_ARRAY(sony1MCsnCfg)     },
1554
 
        {    0x0004, Group::sonymltmn, EXV_BINARY_ARRAY(sony1MCs7Cfg, minoCs7Def)}, // minoCs7Def [sic]
1555
 
        {    0x0088, Group::sonymltmn, newTiffThumbData<0x0089, Group::sonymltmn>},
1556
 
        {    0x0089, Group::sonymltmn, newTiffThumbSize<0x0088, Group::sonymltmn>},
1557
 
        {    0x0114, Group::sonymltmn, EXV_BINARY_ARRAY(sony1MCsA100Cfg, sony1MCsA100Def)},
1558
 
        { Tag::next, Group::sonymltmn, newTiffDirectory<Group::ignr>             },
1559
 
        {  Tag::all, Group::sonymltmn, newTiffEntry                              },
 
1622
        {    0x0001, sonyMltId,        EXV_SIMPLE_BINARY_ARRAY(sony1MCsoCfg)     },
 
1623
        {    0x0003, sonyMltId,        EXV_SIMPLE_BINARY_ARRAY(sony1MCsnCfg)     },
 
1624
        {    0x0004, sonyMltId,        EXV_BINARY_ARRAY(sony1MCs7Cfg, minoCs7Def)}, // minoCs7Def [sic]
 
1625
        {    0x0088, sonyMltId,        newTiffThumbData<0x0089, sonyMltId>       },
 
1626
        {    0x0089, sonyMltId,        newTiffThumbSize<0x0088, sonyMltId>       },
 
1627
        {    0x0114, sonyMltId,        EXV_BINARY_ARRAY(sony1MCsA100Cfg, sony1MCsA100Def)},
 
1628
        { Tag::next, sonyMltId,        newTiffDirectory<ignoreId>                },
 
1629
        {  Tag::all, sonyMltId,        newTiffEntry                              },
1560
1630
 
1561
1631
        // Sony1 Minolta makernote composite tags
1562
 
        {  Tag::all, Group::sony1mcso, newTiffBinaryElement                      },
1563
 
        {  Tag::all, Group::sony1mcsn, newTiffBinaryElement                      },
1564
 
        {  Tag::all, Group::sony1mcs7, newTiffBinaryElement                      },
1565
 
        {  Tag::all, Group::sony1mcsa100,newTiffBinaryElement                    },
 
1632
        {  Tag::all, sony1MltCsOldId,  newTiffBinaryElement                      },
 
1633
        {  Tag::all, sony1MltCsNewId,  newTiffBinaryElement                      },
 
1634
        {  Tag::all, sony1MltCs7DId,   newTiffBinaryElement                      },
 
1635
        {  Tag::all, sony1MltCsA100Id, newTiffBinaryElement                      },
1566
1636
 
1567
1637
        // Minolta makernote
1568
 
        {    0x0001, Group::minoltamn, EXV_SIMPLE_BINARY_ARRAY(minoCsoCfg)       },
1569
 
        {    0x0003, Group::minoltamn, EXV_SIMPLE_BINARY_ARRAY(minoCsnCfg)       },
1570
 
        {    0x0004, Group::minoltamn, EXV_BINARY_ARRAY(minoCs7Cfg, minoCs7Def)  },
1571
 
        {    0x0088, Group::minoltamn, newTiffThumbData<0x0089, Group::minoltamn>},
1572
 
        {    0x0089, Group::minoltamn, newTiffThumbSize<0x0088, Group::minoltamn>},
1573
 
        {    0x0114, Group::minoltamn, EXV_BINARY_ARRAY(minoCs5Cfg, minoCs5Def)  },
1574
 
        { Tag::next, Group::minoltamn, newTiffDirectory<Group::ignr>             },
1575
 
        {  Tag::all, Group::minoltamn, newTiffEntry                              },
 
1638
        {    0x0001, minoltaId,        EXV_SIMPLE_BINARY_ARRAY(minoCsoCfg)       },
 
1639
        {    0x0003, minoltaId,        EXV_SIMPLE_BINARY_ARRAY(minoCsnCfg)       },
 
1640
        {    0x0004, minoltaId,        EXV_BINARY_ARRAY(minoCs7Cfg, minoCs7Def)  },
 
1641
        {    0x0088, minoltaId,        newTiffThumbData<0x0089, minoltaId>       },
 
1642
        {    0x0089, minoltaId,        newTiffThumbSize<0x0088, minoltaId>       },
 
1643
        {    0x0114, minoltaId,        EXV_BINARY_ARRAY(minoCs5Cfg, minoCs5Def)  },
 
1644
        { Tag::next, minoltaId,        newTiffDirectory<ignoreId>                },
 
1645
        {  Tag::all, minoltaId,        newTiffEntry                              },
1576
1646
 
1577
1647
        // Minolta makernote composite tags
1578
 
        {  Tag::all, Group::minocso,   newTiffBinaryElement                      },
1579
 
        {  Tag::all, Group::minocsn,   newTiffBinaryElement                      },
1580
 
        {  Tag::all, Group::minocs7,   newTiffBinaryElement                      },
1581
 
        {  Tag::all, Group::minocs5,   newTiffBinaryElement                      },
 
1648
        {  Tag::all, minoltaCsOldId,   newTiffBinaryElement                      },
 
1649
        {  Tag::all, minoltaCsNewId,   newTiffBinaryElement                      },
 
1650
        {  Tag::all, minoltaCs7DId,    newTiffBinaryElement                      },
 
1651
        {  Tag::all, minoltaCs5DId,    newTiffBinaryElement                      },
1582
1652
 
1583
1653
        // -----------------------------------------------------------------------
1584
1654
        // Root directory of Panasonic RAW images
1585
 
        { Tag::pana, Group::none,      newTiffDirectory<Group::panaraw>          },
 
1655
        { Tag::pana, ifdIdNotSet,      newTiffDirectory<panaRawId>               },
1586
1656
 
1587
1657
        // IFD0 of Panasonic RAW images
1588
 
        {    0x8769, Group::panaraw,   newTiffSubIfd<Group::exif>                },
1589
 
        {    0x8825, Group::panaraw,   newTiffSubIfd<Group::gps>                 },
1590
 
//        {    0x0111, Group::panaraw,   newTiffImageData<0x0117, Group::panaraw>  },
1591
 
//        {    0x0117, Group::panaraw,   newTiffImageSize<0x0111, Group::panaraw>  },
1592
 
        { Tag::next, Group::panaraw,   newTiffDirectory<Group::ignr>             },
1593
 
        {  Tag::all, Group::panaraw,   newTiffEntry                              },
 
1658
        {    0x8769, panaRawId,        newTiffSubIfd<exifId>                     },
 
1659
        {    0x8825, panaRawId,        newTiffSubIfd<gpsId>                      },
 
1660
//        {    0x0111, panaRawId,        newTiffImageData<0x0117, panaRawId>       },
 
1661
//        {    0x0117, panaRawId,        newTiffImageSize<0x0111, panaRawId>       },
 
1662
        { Tag::next, panaRawId,        newTiffDirectory<ignoreId>                },
 
1663
        {  Tag::all, panaRawId,        newTiffEntry                              },
1594
1664
 
1595
1665
        // -----------------------------------------------------------------------
1596
1666
        // Tags which are not de/encoded
1597
 
        { Tag::next, Group::ignr,      newTiffDirectory<Group::ignr>             },
1598
 
        {  Tag::all, Group::ignr,      newTiffEntry                              }
 
1667
        { Tag::next, ignoreId,           newTiffDirectory<ignoreId>              },
 
1668
        {  Tag::all, ignoreId,           newTiffEntry                            }
1599
1669
    };
1600
1670
 
1601
1671
    // TIFF mapping table for special decoding and encoding requirements
1602
1672
    const TiffMappingInfo TiffMapping::tiffMappingInfo_[] = {
1603
 
        { "*",       Tag::all, Group::ignr,    0, 0 }, // Do not decode tags with group == Group::ignr
1604
 
        { "*",         0x02bc, Group::ifd0,    &TiffDecoder::decodeXmp,          0 /*done before the tree is traversed*/ },
1605
 
        { "*",         0x83bb, Group::ifd0,    &TiffDecoder::decodeIptc,         0 /*done before the tree is traversed*/ },
1606
 
        { "*",         0x8649, Group::ifd0,    &TiffDecoder::decodeIptc,         0 /*done before the tree is traversed*/ }
 
1673
        { "*",       Tag::all, ignoreId,  0, 0 }, // Do not decode tags with group == ignoreId
 
1674
        { "*",         0x02bc, ifd0Id,    &TiffDecoder::decodeXmp,          0 /*done before the tree is traversed*/ },
 
1675
        { "*",         0x83bb, ifd0Id,    &TiffDecoder::decodeIptc,         0 /*done before the tree is traversed*/ },
 
1676
        { "*",         0x8649, ifd0Id,    &TiffDecoder::decodeIptc,         0 /*done before the tree is traversed*/ }
1607
1677
    };
1608
1678
 
1609
1679
    DecoderFct TiffMapping::findDecoder(const std::string& make,
1610
1680
                                              uint32_t     extendedTag,
1611
 
                                              uint16_t     group)
 
1681
                                              IfdId        group)
1612
1682
    {
1613
1683
        DecoderFct decoderFct = &TiffDecoder::decodeStdTiffEntry;
1614
1684
        const TiffMappingInfo* td = find(tiffMappingInfo_,
1623
1693
    EncoderFct TiffMapping::findEncoder(
1624
1694
        const std::string& make,
1625
1695
              uint32_t     extendedTag,
1626
 
              uint16_t     group
 
1696
              IfdId        group
1627
1697
    )
1628
1698
    {
1629
1699
        EncoderFct encoderFct = 0;
1642
1712
    }
1643
1713
 
1644
1714
    TiffComponent::AutoPtr TiffCreator::create(uint32_t extendedTag,
1645
 
                                               uint16_t group)
 
1715
                                               IfdId    group)
1646
1716
    {
1647
1717
        TiffComponent::AutoPtr tc(0);
1648
1718
        uint16_t tag = static_cast<uint16_t>(extendedTag & 0xffff);
1661
1731
            }
1662
1732
            std::cerr << "extended tag 0x" << std::setw(4) << std::setfill('0')
1663
1733
                      << std::hex << std::right << extendedTag
1664
 
                      << ", group " << tiffGroupName(group) << "\n";
 
1734
                      << ", group " << ifdItem(group) << "\n";
1665
1735
        }
1666
1736
#endif
1667
1737
        return tc;
1669
1739
 
1670
1740
    void TiffCreator::getPath(TiffPath& tiffPath,
1671
1741
                              uint32_t  extendedTag,
1672
 
                              uint16_t  group,
 
1742
                              IfdId     group,
1673
1743
                              uint32_t  root)
1674
1744
    {
1675
1745
        const TiffTreeStruct* ts = 0;
1679
1749
            assert(ts != 0);
1680
1750
            extendedTag = ts->parentExtTag_;
1681
1751
            group = ts->parentGroup_;
1682
 
        } while (!(ts->root_ == root && ts->group_ == Group::none));
 
1752
        } while (!(ts->root_ == root && ts->group_ == ifdIdNotSet));
1683
1753
 
1684
1754
    } // TiffCreator::getPath
1685
1755
 
1752
1822
            if (!encoder.dirty()) writeMethod = wmNonIntrusive;
1753
1823
        }
1754
1824
        if (writeMethod == wmIntrusive) {
1755
 
            TiffComponent::AutoPtr createdTree = TiffCreator::create(root, Group::none);
 
1825
            TiffComponent::AutoPtr createdTree = TiffCreator::create(root, ifdIdNotSet);
1756
1826
            if (0 != parsedTree.get()) {
1757
1827
                // Copy image tags from the original image to the composite
1758
1828
                TiffCopier copier(createdTree.get(), root, pHeader, &primaryGroups);
1804
1874
        if (!pHeader->read(pData, size) || pHeader->offset() >= size) {
1805
1875
            throw Error(3, "TIFF");
1806
1876
        }
1807
 
        TiffComponent::AutoPtr rootDir = TiffCreator::create(root, Group::none);
 
1877
        TiffComponent::AutoPtr rootDir = TiffCreator::create(root, ifdIdNotSet);
1808
1878
        if (0 != rootDir.get()) {
1809
1879
            rootDir->setStart(pData + pHeader->offset());
1810
1880
            TiffRwState::AutoPtr state(
1822
1892
    {
1823
1893
        if (0 == pSourceDir) return;
1824
1894
 
1825
 
        const uint16_t imageGroups[] = {
1826
 
            Group::ifd0,
1827
 
            Group::ifd1,
1828
 
            Group::ifd2,
1829
 
            Group::ifd3,
1830
 
            Group::subimg1,
1831
 
            Group::subimg2,
1832
 
            Group::subimg3,
1833
 
            Group::subimg4,
1834
 
            Group::subimg5,
1835
 
            Group::subimg6,
1836
 
            Group::subimg7,
1837
 
            Group::subimg8,
1838
 
            Group::subimg9
 
1895
        const IfdId imageGroups[] = {
 
1896
            ifd0Id,
 
1897
            ifd1Id,
 
1898
            ifd2Id,
 
1899
            ifd3Id,
 
1900
            subImage1Id,
 
1901
            subImage2Id,
 
1902
            subImage3Id,
 
1903
            subImage4Id,
 
1904
            subImage5Id,
 
1905
            subImage6Id,
 
1906
            subImage7Id,
 
1907
            subImage8Id,
 
1908
            subImage9Id
1839
1909
        };
1840
1910
 
1841
1911
        for (unsigned int i = 0; i < EXV_COUNTOF(imageGroups); ++i) {
1952
2022
        return tag_;
1953
2023
    }
1954
2024
 
1955
 
    bool TiffHeaderBase::isImageTag(uint16_t /*tag*/,
1956
 
                                    uint16_t /*group*/,
 
2025
    bool TiffHeaderBase::isImageTag(      uint16_t       /*tag*/,
 
2026
                                          IfdId          /*group*/,
1957
2027
                                    const PrimaryGroups* /*primaryGroups*/) const
1958
2028
    {
1959
2029
        return false;
1970
2040
    }
1971
2041
 
1972
2042
    bool TiffHeader::isImageTag(      uint16_t       tag,
1973
 
                                      uint16_t       group,
 
2043
                                      IfdId          group,
1974
2044
                                const PrimaryGroups* pPrimaryGroups) const
1975
2045
    {
1976
2046
        //! List of TIFF image tags
1977
2047
        static const TiffImgTagStruct tiffImageTags[] = {
1978
 
            { 0x00fe, Group::ifd0 }, // Exif.Image.NewSubfileType
1979
 
            { 0x00ff, Group::ifd0 }, // Exif.Image.SubfileType
1980
 
            { 0x0100, Group::ifd0 }, // Exif.Image.ImageWidth
1981
 
            { 0x0101, Group::ifd0 }, // Exif.Image.ImageLength
1982
 
            { 0x0102, Group::ifd0 }, // Exif.Image.BitsPerSample
1983
 
            { 0x0103, Group::ifd0 }, // Exif.Image.Compression
1984
 
            { 0x0106, Group::ifd0 }, // Exif.Image.PhotometricInterpretation
1985
 
            { 0x010a, Group::ifd0 }, // Exif.Image.FillOrder
1986
 
            { 0x0111, Group::ifd0 }, // Exif.Image.StripOffsets
1987
 
            { 0x0115, Group::ifd0 }, // Exif.Image.SamplesPerPixel
1988
 
            { 0x0116, Group::ifd0 }, // Exif.Image.RowsPerStrip
1989
 
            { 0x0117, Group::ifd0 }, // Exif.Image.StripByteCounts
1990
 
            { 0x011a, Group::ifd0 }, // Exif.Image.XResolution
1991
 
            { 0x011b, Group::ifd0 }, // Exif.Image.YResolution
1992
 
            { 0x011c, Group::ifd0 }, // Exif.Image.PlanarConfiguration
1993
 
            { 0x0122, Group::ifd0 }, // Exif.Image.GrayResponseUnit
1994
 
            { 0x0123, Group::ifd0 }, // Exif.Image.GrayResponseCurve
1995
 
            { 0x0124, Group::ifd0 }, // Exif.Image.T4Options
1996
 
            { 0x0125, Group::ifd0 }, // Exif.Image.T6Options
1997
 
            { 0x0128, Group::ifd0 }, // Exif.Image.ResolutionUnit
1998
 
            { 0x012d, Group::ifd0 }, // Exif.Image.TransferFunction
1999
 
            { 0x013d, Group::ifd0 }, // Exif.Image.Predictor
2000
 
            { 0x013e, Group::ifd0 }, // Exif.Image.WhitePoint
2001
 
            { 0x013f, Group::ifd0 }, // Exif.Image.PrimaryChromaticities
2002
 
            { 0x0140, Group::ifd0 }, // Exif.Image.ColorMap
2003
 
            { 0x0141, Group::ifd0 }, // Exif.Image.HalftoneHints
2004
 
            { 0x0142, Group::ifd0 }, // Exif.Image.TileWidth
2005
 
            { 0x0143, Group::ifd0 }, // Exif.Image.TileLength
2006
 
            { 0x0144, Group::ifd0 }, // Exif.Image.TileOffsets
2007
 
            { 0x0145, Group::ifd0 }, // Exif.Image.TileByteCounts
2008
 
            { 0x014c, Group::ifd0 }, // Exif.Image.InkSet
2009
 
            { 0x014d, Group::ifd0 }, // Exif.Image.InkNames
2010
 
            { 0x014e, Group::ifd0 }, // Exif.Image.NumberOfInks
2011
 
            { 0x0150, Group::ifd0 }, // Exif.Image.DotRange
2012
 
            { 0x0151, Group::ifd0 }, // Exif.Image.TargetPrinter
2013
 
            { 0x0152, Group::ifd0 }, // Exif.Image.ExtraSamples
2014
 
            { 0x0153, Group::ifd0 }, // Exif.Image.SampleFormat
2015
 
            { 0x0154, Group::ifd0 }, // Exif.Image.SMinSampleValue
2016
 
            { 0x0155, Group::ifd0 }, // Exif.Image.SMaxSampleValue
2017
 
            { 0x0156, Group::ifd0 }, // Exif.Image.TransferRange
2018
 
            { 0x0157, Group::ifd0 }, // Exif.Image.ClipPath
2019
 
            { 0x0158, Group::ifd0 }, // Exif.Image.XClipPathUnits
2020
 
            { 0x0159, Group::ifd0 }, // Exif.Image.YClipPathUnits
2021
 
            { 0x015a, Group::ifd0 }, // Exif.Image.Indexed
2022
 
            { 0x015b, Group::ifd0 }, // Exif.Image.JPEGTables
2023
 
            { 0x0200, Group::ifd0 }, // Exif.Image.JPEGProc
2024
 
            { 0x0201, Group::ifd0 }, // Exif.Image.JPEGInterchangeFormat
2025
 
            { 0x0202, Group::ifd0 }, // Exif.Image.JPEGInterchangeFormatLength
2026
 
            { 0x0203, Group::ifd0 }, // Exif.Image.JPEGRestartInterval
2027
 
            { 0x0205, Group::ifd0 }, // Exif.Image.JPEGLosslessPredictors
2028
 
            { 0x0206, Group::ifd0 }, // Exif.Image.JPEGPointTransforms
2029
 
            { 0x0207, Group::ifd0 }, // Exif.Image.JPEGQTables
2030
 
            { 0x0208, Group::ifd0 }, // Exif.Image.JPEGDCTables
2031
 
            { 0x0209, Group::ifd0 }, // Exif.Image.JPEGACTables
2032
 
            { 0x0211, Group::ifd0 }, // Exif.Image.YCbCrCoefficients
2033
 
            { 0x0212, Group::ifd0 }, // Exif.Image.YCbCrSubSampling
2034
 
            { 0x0213, Group::ifd0 }, // Exif.Image.YCbCrPositioning
2035
 
            { 0x0214, Group::ifd0 }, // Exif.Image.ReferenceBlackWhite
2036
 
            { 0x828d, Group::ifd0 }, // Exif.Image.CFARepeatPatternDim
2037
 
            { 0x828e, Group::ifd0 }, // Exif.Image.CFAPattern
2038
 
            { 0x8773, Group::ifd0 }, // Exif.Image.InterColorProfile
2039
 
            { 0x8824, Group::ifd0 }, // Exif.Image.SpectralSensitivity
2040
 
            { 0x8828, Group::ifd0 }, // Exif.Image.OECF
2041
 
            { 0x9102, Group::ifd0 }, // Exif.Image.CompressedBitsPerPixel
2042
 
            { 0x9217, Group::ifd0 }, // Exif.Image.SensingMethod
 
2048
            { 0x00fe, ifd0Id }, // Exif.Image.NewSubfileType
 
2049
            { 0x00ff, ifd0Id }, // Exif.Image.SubfileType
 
2050
            { 0x0100, ifd0Id }, // Exif.Image.ImageWidth
 
2051
            { 0x0101, ifd0Id }, // Exif.Image.ImageLength
 
2052
            { 0x0102, ifd0Id }, // Exif.Image.BitsPerSample
 
2053
            { 0x0103, ifd0Id }, // Exif.Image.Compression
 
2054
            { 0x0106, ifd0Id }, // Exif.Image.PhotometricInterpretation
 
2055
            { 0x010a, ifd0Id }, // Exif.Image.FillOrder
 
2056
            { 0x0111, ifd0Id }, // Exif.Image.StripOffsets
 
2057
            { 0x0115, ifd0Id }, // Exif.Image.SamplesPerPixel
 
2058
            { 0x0116, ifd0Id }, // Exif.Image.RowsPerStrip
 
2059
            { 0x0117, ifd0Id }, // Exif.Image.StripByteCounts
 
2060
            { 0x011a, ifd0Id }, // Exif.Image.XResolution
 
2061
            { 0x011b, ifd0Id }, // Exif.Image.YResolution
 
2062
            { 0x011c, ifd0Id }, // Exif.Image.PlanarConfiguration
 
2063
            { 0x0122, ifd0Id }, // Exif.Image.GrayResponseUnit
 
2064
            { 0x0123, ifd0Id }, // Exif.Image.GrayResponseCurve
 
2065
            { 0x0124, ifd0Id }, // Exif.Image.T4Options
 
2066
            { 0x0125, ifd0Id }, // Exif.Image.T6Options
 
2067
            { 0x0128, ifd0Id }, // Exif.Image.ResolutionUnit
 
2068
            { 0x012d, ifd0Id }, // Exif.Image.TransferFunction
 
2069
            { 0x013d, ifd0Id }, // Exif.Image.Predictor
 
2070
            { 0x013e, ifd0Id }, // Exif.Image.WhitePoint
 
2071
            { 0x013f, ifd0Id }, // Exif.Image.PrimaryChromaticities
 
2072
            { 0x0140, ifd0Id }, // Exif.Image.ColorMap
 
2073
            { 0x0141, ifd0Id }, // Exif.Image.HalftoneHints
 
2074
            { 0x0142, ifd0Id }, // Exif.Image.TileWidth
 
2075
            { 0x0143, ifd0Id }, // Exif.Image.TileLength
 
2076
            { 0x0144, ifd0Id }, // Exif.Image.TileOffsets
 
2077
            { 0x0145, ifd0Id }, // Exif.Image.TileByteCounts
 
2078
            { 0x014c, ifd0Id }, // Exif.Image.InkSet
 
2079
            { 0x014d, ifd0Id }, // Exif.Image.InkNames
 
2080
            { 0x014e, ifd0Id }, // Exif.Image.NumberOfInks
 
2081
            { 0x0150, ifd0Id }, // Exif.Image.DotRange
 
2082
            { 0x0151, ifd0Id }, // Exif.Image.TargetPrinter
 
2083
            { 0x0152, ifd0Id }, // Exif.Image.ExtraSamples
 
2084
            { 0x0153, ifd0Id }, // Exif.Image.SampleFormat
 
2085
            { 0x0154, ifd0Id }, // Exif.Image.SMinSampleValue
 
2086
            { 0x0155, ifd0Id }, // Exif.Image.SMaxSampleValue
 
2087
            { 0x0156, ifd0Id }, // Exif.Image.TransferRange
 
2088
            { 0x0157, ifd0Id }, // Exif.Image.ClipPath
 
2089
            { 0x0158, ifd0Id }, // Exif.Image.XClipPathUnits
 
2090
            { 0x0159, ifd0Id }, // Exif.Image.YClipPathUnits
 
2091
            { 0x015a, ifd0Id }, // Exif.Image.Indexed
 
2092
            { 0x015b, ifd0Id }, // Exif.Image.JPEGTables
 
2093
            { 0x0200, ifd0Id }, // Exif.Image.JPEGProc
 
2094
            { 0x0201, ifd0Id }, // Exif.Image.JPEGInterchangeFormat
 
2095
            { 0x0202, ifd0Id }, // Exif.Image.JPEGInterchangeFormatLength
 
2096
            { 0x0203, ifd0Id }, // Exif.Image.JPEGRestartInterval
 
2097
            { 0x0205, ifd0Id }, // Exif.Image.JPEGLosslessPredictors
 
2098
            { 0x0206, ifd0Id }, // Exif.Image.JPEGPointTransforms
 
2099
            { 0x0207, ifd0Id }, // Exif.Image.JPEGQTables
 
2100
            { 0x0208, ifd0Id }, // Exif.Image.JPEGDCTables
 
2101
            { 0x0209, ifd0Id }, // Exif.Image.JPEGACTables
 
2102
            { 0x0211, ifd0Id }, // Exif.Image.YCbCrCoefficients
 
2103
            { 0x0212, ifd0Id }, // Exif.Image.YCbCrSubSampling
 
2104
            { 0x0213, ifd0Id }, // Exif.Image.YCbCrPositioning
 
2105
            { 0x0214, ifd0Id }, // Exif.Image.ReferenceBlackWhite
 
2106
            { 0x828d, ifd0Id }, // Exif.Image.CFARepeatPatternDim
 
2107
            { 0x828e, ifd0Id }, // Exif.Image.CFAPattern
 
2108
            { 0x8773, ifd0Id }, // Exif.Image.InterColorProfile
 
2109
            { 0x8824, ifd0Id }, // Exif.Image.SpectralSensitivity
 
2110
            { 0x8828, ifd0Id }, // Exif.Image.OECF
 
2111
            { 0x9102, ifd0Id }, // Exif.Image.CompressedBitsPerPixel
 
2112
            { 0x9217, ifd0Id }, // Exif.Image.SensingMethod
2043
2113
        };
2044
2114
 
2045
2115
        if (!hasImageTags_) {
2049
2119
            return false;
2050
2120
        }
2051
2121
#ifdef DEBUG
2052
 
        ExifKey key(tag, tiffGroupName(group));
 
2122
        ExifKey key(tag, ifdItem(group));
2053
2123
#endif
2054
2124
        // If there are primary groups and none matches group, we're done
2055
2125
        if (   pPrimaryGroups != 0
2065
2135
        // image tags. That should take care of NEFs until we know better.
2066
2136
        if (   pPrimaryGroups != 0
2067
2137
            && !pPrimaryGroups->empty()
2068
 
            && group != Group::ifd0) {
 
2138
            && group != ifd0Id) {
2069
2139
#ifdef DEBUG
2070
 
            ExifKey key(tag, tiffGroupName(group));
 
2140
            ExifKey key(tag, ifdItem(group));
2071
2141
            std::cerr << "Image tag: " << key << " (2)\n";
2072
2142
#endif
2073
2143
            return true;
2075
2145
        // If tag, group is one of the image tags listed above -> bingo!
2076
2146
        if (find(tiffImageTags, TiffImgTagStruct::Key(tag, group))) {
2077
2147
#ifdef DEBUG
2078
 
            ExifKey key(tag, tiffGroupName(group));
 
2148
            ExifKey key(tag, ifdItem(group));
2079
2149
            std::cerr << "Image tag: " << key << " (3)\n";
2080
2150
#endif
2081
2151
            return true;