On android image / photo orientation is always wrong

Please provide the following:

  1. SDK Version: 36
  2. Platforms(Android/iOS/web/all): Android

Whenever I take a picture with android the exif is not recognized and the orientation is incorrect. I’ve tried setting the skipProcessing: true, and still have the same issue:

    handleShortCapture = async () => {

      const takePicOptions = {
        skipProcessing: true,
        exif: true,
      }
      const photoData = await this.camera.takePictureAsync(takePicOptions).then(
        async (data) => {
          console.log('this width and height')
          console.log(data.width);
          console.log(data.height);
          let rotation = 0;
          if(data.exif.PixelXDimension > data.exif.PixelYDimension) {
            rotation = -90
          }
          console.log('this is exif');
          console.log(data.exif);
          const saveOptions = {
            compress: 1, format: "jpeg", base64: false
          }
          await ImageManipulator.manipulateAsync(
            data.uri,
            [ {rotate: rotation},
              { resize: { width: 900 } }], saveOptions
          ). then(img => {
          this.setState({ capturing: false, captures: [img, ...this.state.captures] })
        })
        }
      )
    }

When the picture is taken the landscape orientation is not recognized. I tried fixing the issue by checking the width returned if it was larger having it rotate but the width and also the exif are incorrect.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.