【问题标题】:Set EXIF geolocation using CameraX使用 CameraX 设置 EXIF 地理位置
【发布时间】:2020-07-27 22:52:34
【问题描述】:

如何使用 CameraX API 在图像 EXIF 中添加位置信息。我使用 https://codelabs.developers.google.com/codelabs/camerax-getting-started/#4 创建了自己的应用程序。

我筛选了 https://developer.android.com/training/cameraxhttps://developer.android.com/jetpack/androidx/releases/exifinterface,但没有找到任何指南。

【问题讨论】:

    标签: exif android-camerax


    【解决方案1】:

    如果你拍了一张照片,你会覆盖onImageSaved。在那里,您可以将 exif 数据写入您的照片。我只有Java,但原理是一样的。

     ExifInterface exif = null;
          try {
              exif = new ExifInterface(PhotoPath);
          } catch (IOException e) {
              e.printStackTrace();
          }
     exif.setAttribute(ExifInterface.TAG_GPS_LATITUDE, "location");
    

    您可以查找不同的标签here。如何获取位置是here,如果您需要更多关于如何在exif 中存储位置的信息,请查看here

    【讨论】:

      猜你喜欢
      • 2011-09-21
      • 2020-12-28
      • 1970-01-01
      • 1970-01-01
      • 2020-01-23
      • 1970-01-01
      • 1970-01-01
      • 2018-10-17
      • 1970-01-01
      相关资源
      最近更新 更多