ideacreation / react-native-barcodescanner

A barcode scanner component for react native - not maintained anymore - use react-native-camera
MIT License
537 stars 162 forks source link

[Android] Camera Image is rotated 90° #54

Open ohmyguigs opened 7 years ago

ohmyguigs commented 7 years ago

I'm using React-Native 0.22.2 and Android SDK with API level 19 (KitKat). Camera shows up, read barcodes with success, but image is displayed 90° clockwise. viewFinder and viewFinderDrawLaser shows up on the right position (not rotated). I have the permissions on my AndroidManifest.xml: <uses-permission android:name="android.permission.CAMERA" /> App only works in portrait mode, so phone is locked in portrait and orientetion never changes. This is what my component renders: ` render() { let camera = ; let childrenContainerStyle = { flex: 1 };

if(this.props.status == 'in-use') {
  camera = (
    <CameraScanner
      onBarCodeRead={this.onBarCodeRead}
      style={styles.barcodeScanner}
      torchMode={'off'}
      viewFinderDrawLaser={true}
      cameraType={'back'}
    />
  );
}

return (
  <View style={[this.props.style]}>
    <View style={childrenContainerStyle}>
      {this.props.children}
    </View>
    {camera}
  </View>
);

} }

var styles = StyleSheet.create({ barcodeScanner: { flex: 1 }`

tl;dr -> it's all working good, but camera image is flipped 90° clockwise. 😢

grundmanise commented 7 years ago

Same here. Camera rotated 90°. (tested only in simulator, using notebook webcamera)

ohmyguigs commented 7 years ago

@grundmanise if you need so, im using like this https://github.com/resendefreitas/react-native-barcodescanner 😁 for now 😅