camera.getPicture 在来自 select 画廊的 cordova ios 中滞后了太多时间

camera.getPicture is lagging too much of time in cordova ios from select gallery

我使用 cordova 相机插件从 ios 中的图库中获取图片,对我来说,图片库文件显示速度不快,加载时间太长... 我只使用下面的代码。它可以正常工作,但是加载 Photolibrary 需要花费太多时间,还有一件事是 savetoPhotoAlbum 无法正常工作。 但是对于 android 这两个工作正常,它只在 iOS

上滞后
navigator.camera.getPicture(onPhotoDataSuccess, onFail, {
      quality: 30,     
      allowEdit : false,
      encodingType: Camera.EncodingType.JPEG,
      destinationType: destinationType.DATA_URL,
      sourceType: pictureSource.PHOTOLIBRARY
    }); 

请任何人帮助我...

重要的是在选项中给 "mediaType" 值,例如 "mediaType: this.camera.MediaType.PICTURE"。

  getImage(pictureSourceType, crop = true, quality = 50, allowEdit = true, saveToAlbum = true) {
    const options = {
      quality,
      allowEdit,
      destinationType: this.camera.DestinationType.FILE_URI,
      sourceType: pictureSourceType,
      encodingType: this.camera.EncodingType.JPEG,
      saveToPhotoAlbum: saveToAlbum,
      mediaType: this.camera.MediaType.PICTURE
    };

    // If set to crop, restricts the image to a square of 600 by 600
    if (crop) {
      options['targetWidth'] = 600;
      options['targetHeight'] = 600;
    }

    return this.camera.getPicture(options).then(imageData => {
      console.log("test 4");
      const base64Image = imageData;
      return base64Image;
    }, error => {
      console.log('CAMERA ERROR -> ' + JSON.stringify(error));
    });