exiv2-Exif_CanonFi_FocusDistance.patch

Roman Lebedev, 11 Apr 2014 08:10

Download (3.99 KB)

View differences:

trunk/src/actions.cpp (working copy)
355 355
        }
356 356
        if (!done) {
357 357
            done = 0 != printTag(exifData, "Exif.CanonSi.SubjectDistance");
358
            done = 0 != printTag(exifData, "Exif.CanonSi.FocusDistanceLower");
359
            done = 0 != printTag(exifData, "Exif.CanonSi.FocusDistanceUpper");
358 360
        }
359 361
        std::cout << std::endl;
360 362

  
trunk/src/canonmn.cpp (working copy)
1283 1283
        TagInfo(0x000f, "ToningEffect", N_("Toning Effect"), N_("Toning Effect"), canonFiId, makerTags, signedShort, 1, EXV_PRINT_TAG(canonToningEffect)),
1284 1284
        TagInfo(0x0010, "MacroMagnification", N_("Macro Magnification"), N_("Macro magnification"), canonFiId, makerTags, signedShort, 1, printValue),
1285 1285
        TagInfo(0x0013, "LiveViewShooting", N_("Live View Shooting"), N_("Live view shooting"), canonFiId, makerTags, signedShort, 1, EXV_PRINT_TAG(canonOffOn)),
1286
        TagInfo(0x0014, "FocusDistanceUpper", N_("Focus Distance Upper"), N_("Focus Distance Upper"), canonFiId, makerTags, signedShort, 1, printFiFocusDistance),
1287
        TagInfo(0x0015, "FocusDistanceLower", N_("Focus Distance Lower"), N_("Focus Distance Lower"), canonFiId, makerTags, signedShort, 1, printFiFocusDistance),
1286 1288
        TagInfo(0x0019, "FlashExposureLock", N_("Flash Exposure Lock"), N_("Flash exposure lock"), canonFiId, makerTags, signedShort, 1, EXV_PRINT_TAG(canonOffOn)),
1287 1289
        // End of list marker
1288 1290
        TagInfo(0xffff, "(UnknownCanonFiTag)", "(UnknownCanonFiTag)", N_("Unknown Canon File Info tag"), canonFiId, makerTags, signedShort, 1, printValue)
......
1701 1703
        return os;
1702 1704
    }
1703 1705

  
1706
    std::ostream& CanonMakerNote::printFiFocusDistance(std::ostream& os,
1707
                                                       const Value& value,
1708
                                                       const ExifData*)
1709
    {
1710
       if (   value.typeId() != signedShort
1711
         || value.count() == 0) return os << value;
1712

  
1713
      std::ostringstream oss;
1714
      oss.copyfmt(os);
1715
      os << std::fixed << std::setprecision(2);
1716

  
1717
      long l = value.toLong();
1718
      if (l == 0xffff) {
1719
        os << "Infinite";
1720
      }
1721
      else {
1722
        os << value.toLong()/100.0 << " m";
1723
      }
1724

  
1725
      os.copyfmt(oss);
1726
      return os;
1727
    }
1728

  
1704 1729
// *****************************************************************************
1705 1730
// free functions
1706 1731

  
trunk/src/canonmn_int.hpp (working copy)
106 106
        static std::ostream& printSi0x0016(std::ostream& os, const Value& value, const ExifData*);
107 107
        //! MeasuredEV2
108 108
        static std::ostream& printSi0x0017(std::ostream& os, const Value& value, const ExifData*);
109
        //! Focus Distance
110
        static std::ostream& printFiFocusDistance(std::ostream& os, const Value& value, const ExifData*);
109 111
        //@}
110 112

  
111 113
    private:
trunk/src/easyaccess.cpp (working copy)
414 414
            "Exif.Photo.SubjectDistance",
415 415
            "Exif.Image.SubjectDistance",
416 416
            "Exif.CanonSi.SubjectDistance",
417
            "Exif.CanonFi.FocusDistanceUpper",
418
            "Exif.CanonFi.FocusDistanceLower",
417 419
            "Exif.MinoltaCsNew.FocusDistance",
418 420
            "Exif.Nikon1.FocusDistance",
419 421
            "Exif.Nikon3.FocusDistance",
Redmine Appliance - Powered by TurnKey Linux