Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Camera - iOS - webPath not starting with capacitor://localhost #501

Closed
WIStudent opened this issue Jun 25, 2021 · 1 comment · Fixed by #502
Closed

Camera - iOS - webPath not starting with capacitor://localhost #501

WIStudent opened this issue Jun 25, 2021 · 1 comment · Fixed by #502

Comments

@WIStudent
Copy link

WIStudent commented Jun 25, 2021

Bug Report

Plugin(s)

@capacitor/camera@1.0.2

Capacitor Version

Latest Dependencies:

  @capacitor/cli: 3.0.2
  @capacitor/core: 3.0.2
  @capacitor/android: 3.0.2
  @capacitor/ios: 3.0.2

Installed Dependencies:

  @capacitor/cli: 3.0.2
  @capacitor/core: 3.0.2
  @capacitor/android: 3.0.2
  @capacitor/ios: 3.0.2

Platform(s)

iOS

Current Behavior

When using getPhoto with resultType: CameraResultType.Uri on iOS, the returned webPath value ist missing the capacitor://localhost part at the beginning. Instead something like this is returned: _capacitor_file_/private/var/mobile/Containers/Data/Application/<id omitted by me>/tmp/photo-9.jpg

Expected Behavior

Passing the returned path value through Capacitor.convertFileSrc returns something like capacitor://localhost/_capacitor_file_/private/var/mobile/Containers/Data/Application/<id omitted by me>/tmp/photo-9.jpg, so webPath should look like this too.

On android webPath correctly begins with the android specific prefix http://localhost.

Code Reproduction

Use getPhoto with CameraResultType.Uri:

import { CameraResultType, Camera, CameraSource } from '@capacitor/camera';

const {webPath, path} = await Camera.getPhoto({
  source: CameraSource.Camera
  quality: 50,
  saveToGallery: false,
  correctOrientation: true,
  resultType: CameraResultType.Uri
});

Additional Context

Workaround: Instead of using webPath, use the value returned by Capacitor.convertFileSrc(path).

@ionitron-bot
Copy link

ionitron-bot bot commented Sep 30, 2022

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of the plugin, please create a new issue and ensure the template is fully filled out.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Sep 30, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants