Project

General

Profile

Patch #1122 » hack.patch

Steve Fosdick, 29 Sep 2015 21:29

View differences:

exiv2-0.25-new/src/canonmn.cpp 2015-09-29 22:18:50.562207860 +0100
66 66
    std::ostream& printCsLensByFocalLength(std::ostream& os,
67 67
                                           const Value& value,
68 68
                                           const ExifData* metadata);
69
    std::ostream& printCsLensByFocalLengthTC(std::ostream& os,
70
                                           const Value& value,
71
                                           const ExifData* metadata);
69 72

  
70 73
    //! ModelId, tag 0x0010
71 74
    extern const TagDetails canonModelId[] = {
......
798 801
        { 173, "Canon EF 180mm Macro f/3.5L"                                }, // 0
799 802
        { 173, "Sigma 180mm EX HSM Macro f/3.5"                             }, // 1
800 803
        { 173, "Sigma APO Macro 150mm f/3.5 EX DG IF HSM"                   }, // 2
804
        { 173, "Sigma 150-500mm f/5-6.3 APO DG OS HSM + 2x"                 }, // 3
801 805
        { 174, "Canon EF 135mm f/2L"                                        }, // 0
802 806
        { 174, "Sigma 70-200mm f/2.8 EX DG APO OS HSM"                      }, // 1
803 807
        { 174, "Sigma 50-500mm f/4.5-6.3 APO DG OS HSM"                     }, // 2
......
949 953
        { 161, printCsLensByFocalLength },
950 954
        { 169, printCsLensByFocalLength },
951 955
        { 172, printCsLensByFocalLength }, // not tested
952
        { 173, printCsLensByFocalLength }, // works partly
956
        { 173, printCsLensByFocalLengthTC }, // works partly
953 957
        { 174, printCsLensByFocalLength }, // not tested
954 958
        { 180, printCsLensByFocalLength },
955 959
        { 183, printCsLensByFocalLength }, // not tested
......
1632 1636
        const TagDetails* td = find(canonCsLensType, ltfl);
1633 1637
        if (!td) return os << value;
1634 1638
        return os << td->label_;
1639
    }
1640

  
1641
    std::ostream& printCsLensByFocalLengthTC(std::ostream& os,
1642
                                             const Value& value,
1643
                                             const ExifData* metadata)
1644
    {
1645
        if (   !metadata || value.typeId() != unsignedShort
1646
            || value.count() == 0) return os << value;
1647

  
1648
        LensTypeAndFocalLengthAndMaxAperture ltfl;
1649
        ltfl.lensType_ = value.toLong();
1650

  
1651
        extractLensFocalLength(ltfl, metadata);
1652
        if (ltfl.focalLength_.empty()) return os << value;
1653

  
1654
        if (ltfl.lensType_ == 173 && ltfl.focalLength_.compare("300-1000mm") == 0)
1655
            return os << "Sigma 150-500mm f/5-6.3 APO DG OS HSM + 2x";
1656
        const TagDetails* td = find(canonCsLensType, ltfl);
1657
        if (!td) return os << value;
1658
        return os << td->label_;
1635 1659
    }
1636 1660

  
1637 1661
    std::ostream& CanonMakerNote::printCsLensType(std::ostream& os,
(1-1/3)