expo: Setting pictureSize on the Camera doesn't really affect the size of the image taken

Environment

Expo CLI 2.3.8 environment info:
    System:
      OS: macOS 10.14
      Shell: 3.2.57 - /bin/bash
    Binaries:
      Node: 8.9.4 - ~/.nvm/versions/node/v8.9.4/bin/node
      npm: 5.6.0 - ~/.nvm/versions/node/v8.9.4/bin/npm
      Watchman: 4.9.0 - /usr/local/bin/watchman
    IDEs:
      Android Studio: 2.2 AI-145.3537739
      Xcode: 9.2/9C40b - /usr/bin/xcodebuild
    npmPackages:
      expo: ^30.0.1 => 30.0.1
      react: 16.3.1 => 16.3.1
      react-native: https://github.com/expo/react-native/archive/sdk-30.0.0.tar.gz => 0.55.4
      react-navigation: ^2.18.0 => 2.18.0
    npmGlobalPackages:
      expo-cli: 2.3.8

  Diagnostics report:
    https://exp-xde-diagnostics.s3.amazonaws.com/bberak-d7a0d137-25a7-43ea-9878-51ff2b1ff551.tar.gz

iOS - using iPhone SE with iOS 12.1

Steps to Reproduce

  1. Run the following snack on a physical device: https://snack.expo.io/@bberak/photo-size-bug .The snack is a copy + paste of the camerja example - with a simple alert for printing the size of the take photo.
  2. Open the photo size menu (... on the bottom left).
  3. Select various photo size and take a snap.
  4. After each snap, you will see an alert box that prints the widht and height of the photo.

Expected Behavior

I expect the size output from the alert box to correlate somewhat with the selected photo size in the menu. Eg, taking a ‘1280x720’ shot would result in a photo that is 720 in width and 1280 in height (in portrait mode).

Actual Behavior

The size of the photo is always 2304 x 4090 (approx) in portrait mode - regardless of the selected photo size in the menu. If you take the photo in landscape mode, the photo is always 4090 x 2304 (approx).

Reproducible Demo

https://snack.expo.io/@bberak/photo-size-bug

Huge Thanks

Huge thanks for creating a great platform - and let me know if I can provide any more info.

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 1
  • Comments: 24 (5 by maintainers)

Commits related to this issue

Most upvoted comments

Hey, @bberak! Thank you for submitting this issue! I’ve just reproduced the problem, you’re absolutely right. Sorry for the inconvenience!

Until we get to fixing this bug you could use ImageManipulator to resize the image to requested size. 🙂

Issue still exists.

Can reproduce on Android and iOS with expo 36. (Only tested in portrait)

Has this been fixed?

The problem still persists

pictureSize appears to affect the preview resolution of the camera within the app, at least in iOS, but does not change the captured image size.

Same issue on web. The size of the taken picture via mobile (brower) and on MacBook Pro is always 640x480 for me, the devices support 4k though. Will this be addressed?

Still present with expo-camera ~13.4.4 (Verified on iOS)