D18010: Allow zero altitude/longitude/latitude exiv gps data

Stefan BrĂ¼ns noreply at phabricator.kde.org
Sun Jan 13 17:57:42 GMT 2019


bruns added inline comments.

INLINE COMMENTS

> exiv2extractor.cpp:298
>          }
>      }
>      return alt;

when you rewrite this as

  if (it != data.end()) {
      auto ratio = it->value().toRational();
      it = data.findKey(Exiv2::ExifKey("Exif.GPSInfo.GPSAltitudeRef"));
      if ((ratio.second != 0) && (it != data.end())) {
          auto altRef = it->value().toLong();
          if (altRef) {
              alt = -1.0 * ratio.first / ratio.second;
          } else {
              alt = 1.0 * ratio.first / ratio.second;
          }
      }
  }

does the unit test pass without special handling of the altitude fuzz?

REPOSITORY
  R286 KFileMetaData

BRANCH
  fix_zero_gps

REVISION DETAIL
  https://phabricator.kde.org/D18010

To: astippich, bruns
Cc: kde-frameworks-devel, #baloo, ashaposhnikov, michaelh, astippich, spoorun, ngraham, bruns, abrahams
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20190113/f022b5af/attachment-0001.html>


More information about the Kde-frameworks-devel mailing list