canon-timeinfo.patch

Add support for the Canon TimeInfo MakerNote - Ayke van Laethem, 01 Dec 2016 23:58

Download (8.48 KB)

View differences:

src/canonmn.cpp (working copy)
425 425
        TagInfo(0x0015, "SerialNumberFormat", N_("Serial Number Format"), N_("Serial number format"), canonId, makerTags, unsignedLong, -1, EXV_PRINT_TAG(canonSerialNumberFormat)),
426 426
        TagInfo(0x001a, "SuperMacro", N_("Super Macro"), N_("Super macro"), canonId, makerTags, signedShort, -1, EXV_PRINT_TAG(canonSuperMacro)),
427 427
        TagInfo(0x0026, "AFInfo", N_("AF Info"), N_("AF info"), canonId, makerTags, unsignedShort, -1, printValue),
428
        TagInfo(0x0035, "TimeInfo", N_("Time Info"), N_("Time zone information"), canonId, makerTags, signedLong, -1, printValue),
428 429
        TagInfo(0x0083, "OriginalDecisionDataOffset", N_("Original Decision Data Offset"), N_("Original decision data offset"), canonId, makerTags, signedLong, -1, printValue),
429 430
        TagInfo(0x00a4, "WhiteBalanceTable", N_("White Balance Table"), N_("White balance table"), canonId, makerTags, unsignedShort, -1, printValue),
430 431
        TagInfo(0x0095, "LensModel", N_("Lens Model"), N_("Lens model"), canonId, makerTags, asciiString, -1, printValue),
......
1585 1586
        return tagInfoPr_;
1586 1587
    }
1587 1588

  
1589
    extern const TagDetails canonTimeZoneCity[] = {
1590
        { 0x0000, N_("n/a")                 },
1591
        { 0x0001, N_("Chatham Islands")     },
1592
        { 0x0002, N_("Wellington")          },
1593
        { 0x0003, N_("Solomon Islands")     },
1594
        { 0x0004, N_("Sydney")              },
1595
        { 0x0005, N_("Adelaide")            },
1596
        { 0x0006, N_("Tokyo")               },
1597
        { 0x0007, N_("Hong Kong")           },
1598
        { 0x0008, N_("Bangkok")             },
1599
        { 0x0009, N_("Yangon")              },
1600
        { 0x000a, N_("Dhaka")               },
1601
        { 0x000b, N_("Kathmandu")           },
1602
        { 0x000c, N_("Delhi")               },
1603
        { 0x000d, N_("Karachi")             },
1604
        { 0x000e, N_("Kabul")               },
1605
        { 0x000f, N_("Dubai")               },
1606
        { 0x0010, N_("Tehran")              },
1607
        { 0x0011, N_("Moscow")              },
1608
        { 0x0012, N_("Cairo")               },
1609
        { 0x0013, N_("Paris")               },
1610
        { 0x0014, N_("London")              },
1611
        { 0x0015, N_("Azores")              },
1612
        { 0x0016, N_("Fernando de Noronha") },
1613
        { 0x0017, N_("Sao Paulo")           },
1614
        { 0x0018, N_("Newfoundland")        },
1615
        { 0x0019, N_("Santiago")            },
1616
        { 0x001a, N_("Caracas")             },
1617
        { 0x001b, N_("New York")            },
1618
        { 0x001c, N_("Chicago")             },
1619
        { 0x001d, N_("Denver")              },
1620
        { 0x001e, N_("Los Angeles")         },
1621
        { 0x001f, N_("Anchorage")           },
1622
        { 0x0020, N_("Honolulu")            },
1623
        { 0x0021, N_("Samoa")               },
1624
        { 0x7ffe, N_("(not set)")           },
1625
    };
1626

  
1627
    // Canon Time Info Tag
1628
    const TagInfo CanonMakerNote::tagInfoTi_[] = {
1629
        TagInfo(0x0001, "TimeZone", N_("Time zone offset"), N_("Time zone offset in minutes"), canonTiId, makerTags, signedLong, 1, printValue),
1630
        TagInfo(0x0002, "TimeZoneCity", N_("Time zone city"), N_("Time zone city"), canonTiId, makerTags, signedLong, 1, EXV_PRINT_TAG(canonTimeZoneCity)),
1631
        TagInfo(0x0003, "DaylightSavings", N_("Daylight Savings"), N_("Daylight Saving Time"), canonTiId, makerTags, signedLong, 1, printValue),
1632
        TagInfo(0xffff, "(UnknownCanonTiTag)", "(UnknownCanonTiTag)", N_("Unknown Canon Time Info tag"), canonTiId, makerTags, signedLong, 1, printValue)
1633
    };
1634

  
1635
    const TagInfo* CanonMakerNote::tagListTi()
1636
    {
1637
        return tagInfoTi_;
1638
    }
1639

  
1588 1640
    std::ostream& CanonMakerNote::printFiFileNumber(std::ostream& os,
1589 1641
                                                    const Value& value,
1590 1642
                                                    const ExifData* metadata)
src/canonmn_int.hpp (working copy)
69 69
        static const TagInfo* tagListCf();
70 70
        //! Return read-only list of built-in Canon Picture Info tags
71 71
        static const TagInfo* tagListPi();
72
        //! Return read-only list of built-in Canon Time Info tags
73
        static const TagInfo* tagListTi();
72 74
        //! Return read-only list of built-in Canon File Info tags
73 75
        static const TagInfo* tagListFi();
74 76
        //! Return read-only list of built-in Canon Processing Info tags
......
119 121
        static const TagInfo tagInfoSi_[];
120 122
        static const TagInfo tagInfoCf_[];
121 123
        static const TagInfo tagInfoPi_[];
124
        static const TagInfo tagInfoTi_[];
122 125
        static const TagInfo tagInfoFi_[];
123 126
        static const TagInfo tagInfoPa_[];
124 127
        static const TagInfo tagInfoPr_[];
src/tags.cpp (working copy)
103 103
        { canonSiId,       "Makernote", "CanonSi",      CanonMakerNote::tagListSi      },
104 104
        { canonCfId,       "Makernote", "CanonCf",      CanonMakerNote::tagListCf      },
105 105
        { canonPiId,       "Makernote", "CanonPi",      CanonMakerNote::tagListPi      },
106
        { canonTiId,       "Makernote", "CanonTi",      CanonMakerNote::tagListTi      },
106 107
        { canonFiId,       "Makernote", "CanonFi",      CanonMakerNote::tagListFi      },
107 108
        { canonPaId,       "Makernote", "CanonPa",      CanonMakerNote::tagListPa      },
108 109
        { canonPrId,       "Makernote", "CanonPr",      CanonMakerNote::tagListPr      },
src/tags_int.hpp (working copy)
81 81
        canonCfId,
82 82
        canonPiId,
83 83
        canonPaId,
84
        canonTiId,
84 85
        canonFiId,
85 86
        canonPrId,
86 87
        casioId,
src/tiffimage.cpp (working copy)
425 425
        { 0, ttUnsignedShort, 1 }
426 426
    };
427 427

  
428
    //! Canon Time Info binary array - configuration
429
    extern const ArrayCfg canonTiCfg = {
430
        canonTiId,        // Group for the elements
431
        invalidByteOrder, // Use byte order from parent
432
        ttSignedLong,     // Type for array entry and size element
433
        notEncrypted,     // Not encrypted
434
        true,             // With size element
435
        false,            // No fillers
436
        false,            // Don't concatenate gaps
437
        { 0, ttSignedLong, 1 }
438
    };
439

  
428 440
    //! Canon File Info binary array - configuration
429 441
    extern const ArrayCfg canonFiCfg = {
430 442
        canonFiId,        // Group for the elements
......
1237 1249
        { Tag::root, canonPaId,        canonId,          0x0005    },
1238 1250
        { Tag::root, canonCfId,        canonId,          0x000f    },
1239 1251
        { Tag::root, canonPiId,        canonId,          0x0012    },
1252
        { Tag::root, canonTiId,        canonId,          0x0035    },
1240 1253
        { Tag::root, canonFiId,        canonId,          0x0093    },
1241 1254
        { Tag::root, canonPrId,        canonId,          0x00a0    },
1242 1255
        { Tag::root, nikon1Id,         exifId,           0x927c    },
......
1569 1582
        {    0x0005, canonId,          EXV_SIMPLE_BINARY_ARRAY(canonPaCfg)       },
1570 1583
        {    0x000f, canonId,          EXV_SIMPLE_BINARY_ARRAY(canonCfCfg)       },
1571 1584
        {    0x0012, canonId,          EXV_SIMPLE_BINARY_ARRAY(canonPiCfg)       },
1585
        {    0x0035, canonId,          EXV_SIMPLE_BINARY_ARRAY(canonTiCfg)       },
1572 1586
        {    0x0093, canonId,          EXV_BINARY_ARRAY(canonFiCfg, canonFiDef)  },
1573 1587
        {    0x00a0, canonId,          EXV_SIMPLE_BINARY_ARRAY(canonPrCfg)  },
1574 1588
        { Tag::next, canonId,          ignoreTiffComponent                       },
......
1580 1594
        {  Tag::all, canonPaId,        newTiffBinaryElement                      },
1581 1595
        {  Tag::all, canonCfId,        newTiffBinaryElement                      },
1582 1596
        {  Tag::all, canonPiId,        newTiffBinaryElement                      },
1597
        {  Tag::all, canonTiId,        newTiffBinaryElement                      },
1583 1598
        {  Tag::all, canonFiId,        newTiffBinaryElement                      },
1584 1599
        {  Tag::all, canonPrId,        newTiffBinaryElement                      },
1585 1600

  
Redmine Appliance - Powered by TurnKey Linux