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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Photo is always cropped to square on iOS 17 #2097

Open
kallewangstedt opened this issue May 6, 2024 · 2 comments
Open

Photo is always cropped to square on iOS 17 #2097

kallewangstedt opened this issue May 6, 2024 · 2 comments
Labels
platform: ios type: bug A confirmed bug report

Comments

@kallewangstedt
Copy link

Bug Report

Plugin(s)

@capacitor/camera v6

Capacitor Version

馃拪   Capacitor Doctor  馃拪 

Latest Dependencies:

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

Installed Dependencies:

  @capacitor/android: not installed
  @capacitor/cli: 6.0.0
  @capacitor/core: 6.0.0
  @capacitor/ios: 6.0.0

[success] iOS looking great! 馃憣

Platform(s)

iOS

Current Behavior

Efter taking a photo a square crop border is shown, and the image can not be moved inside the border. When 'Use Photo' is pressed, the image is cropped and inserted into the app. Se image below.

IMG_1570

Expected Behavior

The image should not be cropped and should preserve aspect ratio.

Code Reproduction

  async photo(uuid: string, sourceType: number) {
	if (((await Camera.checkPermissions()).camera) === 'denied' || (await Camera.checkPermissions()).photos === 'denied') {
		if (sourceType === 1){
			await Camera.requestPermissions({ permissions: ['camera'] });
		} else {
			await Camera.requestPermissions({ permissions: ['photos'] });
		}
	}

    const image = await Camera.getPhoto({
      quality: 100,
      allowEditing: true,
	  width: 3024,
	  height: 4032,
      resultType: CameraResultType.Base64,
      source: sourceType == 1 ? CameraSource.Camera : CameraSource.Photos,
	  promptLabelCancel: 'Avbryt',
	  promptLabelPhoto: 'Ta foto',
	  promptLabelPicture: 'V盲lj bild',
	  promptLabelHeader: 'V盲lj bildk盲lla',
    });
    const skold = [
      { bild: { url: `data:image/jpeg;base64,${image.base64String}` } },
    ];

    this.broder.skold = skold;
    this.broder.img = image.base64String;
  }

Other Technical Details

vsCode
Version: 1.88.0 (Universal)
Commit: 5c3e652f63e798a5ac2f31ffd0d863669328dc4c
Date: 2024-04-03T13:28:18.899Z (1 mo ago)
Electron: 28.2.8
ElectronBuildId: 27744544
Chromium: 120.0.6099.291
Node.js: 18.18.2
V8: 12.0.267.19-electron.0
OS: Darwin arm64 23.4.0

Additional Context

@ionitron-bot ionitron-bot bot added the triage label May 6, 2024
@ionitron-bot ionitron-bot bot removed the triage label May 6, 2024
@kallewangstedt kallewangstedt changed the title Photo is always cropped to square on iOS 15 Photo is always cropped to square on iOS 17 May 6, 2024
@IT-MikeS IT-MikeS added the type: bug A confirmed bug report label May 13, 2024
Copy link

ionitron-bot bot commented May 13, 2024

This issue has been labeled as type: bug. This label is added to issues that that have been reproduced and are being tracked in our internal issue tracker.

@masonicboom
Copy link

@kallewangstedt try setting allowEditing: false

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform: ios type: bug A confirmed bug report
Projects
None yet
Development

No branches or pull requests

4 participants