CRNA using expo camera


#1

I am using expo camera in CRNA app. Will it work after I eject the project from CRNA or do i need to replace the expo camera with react-native-camera?


#2

If you detach and use ExpoKit, the Expo camera API will remain. If you completely eject and use bare React Native, it won’t come with any extra modules and you’ll have to use your own.


#3

@ide Thanks for the info. Is there any way to crop the image with respect to the overlay i have in the camera view? I read about the image picker but that wont help in my case as i have to auto crop with the specific overlay. I attached the example pic for overlay and i am trying to crop the image of that specific width and height.


#4

You could maybe place absolutely positioned views on top of the camera to provide the illusion of cropping.


#5

@ide Haha thanks! I can create that illusion but the objective is to crop the image to compress and for other processing purposes.


#6

There is the ImageManipulator API (https://docs.expo.io/versions/latest/sdk/imagemanipulator), which you could use to crop the image afterwards.


#7

Thanks, @ide! I tried using ImageManipulator. It somehow auto-rotates (everytime 90 degrees anti-clockwise) the image before cropping. Is it the expected behaviour? I couldn’t find much about this in docs. I attached the original pic and cropped pic.

Height and width of original pic - 4224 x 2174
Crop parameters : { 0,0,1000,1000}

(I can’t add second pic in the same post, so added in the next one)


#8


#9

Some devices have some unusual bugs around rotating camera images before they are returned, etc. If you are seeing unexpected or inconsistent behavior, please feel free to file a Github issue here with details about the device, etc.: https://github.com/expo/expo/issues

You may have to play with different manipulations to get the image you want.
Good luck!


#10

Thanks @ccheever! The weird thing i observed with expo camera and expo orientation is they are not in sync with the device auto rotate lock as well. I can see that from image exif orientation data.

For example i locked orientation of my app to portrait using expo api and my device native auto rotate is on then i am able to see different orientations. If auto rotate is off then it gives only one orientation.

So is this feature buggy or it is expected?