- SDK Version: 40
- Platforms(Android/iOS/web/all): iOS
- Expo Camera
When I take a picture with the expo-camera package using takePictureAsync()
(with/without specifying the pictureSize
parameter) on iOS, I get an image with resolution depending on the size of the <Camera>
component, and not one of the available pictureSizes (via getAvailablePictureSizesAsync()
):
["640x480","Photo","High","3840x2160","352x288","1280x720","Medium","Low","1920x1080"]
This is the return object:
{"uri":"file:///path/to/image.jpg","width":3796,"height":2376}
If I change the size of the component, the returned picture size and ratio changes as well (eg. to 3538x2376 or 4224x2198). I would expect it to return an image in one of the available picture sizes, at least in one of the available ratios (16:9 or 4:3).
How can make sure I get a high resolution image in one of the available picture sizes?
On Android, I don’t see this behaviour. I get an image of 4000x3000 there.
<Camera style={styles.camera}
type={Camera.Constants.Type.back}
flashMode={Camera.Constants.FlashMode.on}
ratio='4:3'
ref={cameraRef}>...</Camera>
const photo = await cameraRef.current.takePictureAsync({
quality: 1.0,
pictureSize: '3840x2160' // with/without explicit picture size
});
Thanks in advance!
Sander