获取图像名称和拍摄日期-nativescript-imagepicker

时间:2019-04-15 08:25:27

标签: nativescript-vue nativescript-plugin

我是NativeScript-Vue的新手。在我的应用程序中,我具有使用nativescript-imagepicker上传图片的功能。在iOS中,如何获取图像名称和拍摄时间。下面是我正在使用的代码。

context
    .authorize()
    .then(function() {
      return context.present();
    })
    .then(selection => {
      selection.forEach(selected => {
        if (selected._android) {
          file = fileSystemModule.File.fromPath(selected._android);
          //viewModel.uploadFile(file);
        } else {
          imageSourceModule.fromAsset(selected).then(imageSource => {
            this.images.push(imageSource);
            const folder = fileSystemModule.knownFolders.documents().path;
            const fileName = "Photo.png";
            const path = fileSystemModule.path.join(folder, fileName);
            const saved = imageSource.saveToFile(path, "jpg", 60);

          });
        }
      });
    })
    .catch(function(e) {
      console.log("error in selectPicture", e);
    });

0 个答案:

没有答案