Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 Width & height of taken photo is incorrect on Android #2515

Closed
3 of 5 tasks
retyui opened this issue Feb 6, 2024 · 3 comments
Closed
3 of 5 tasks

🐛 Width & height of taken photo is incorrect on Android #2515

retyui opened this issue Feb 6, 2024 · 3 comments
Labels
🐛 bug Something isn't working

Comments

@retyui
Copy link

retyui commented Feb 6, 2024

What's happening?

I use Samsung s10 device with Android 10 to take photo and save it to the gallery

the result of .takePhoto():

file.height: 3024
file.width: 4032
file.orientation: "landscape-right"

but when I checked the photo in the gallery I see a different information width:3024 x height:4032

Screenshot 2024-02-06 at 10 36 57

I think need to take in account an exif orientation and swap a dimension like here: react-native-image-picker/react-native-image-picker@13cdc7c

Reproduceable Code

const file = await camera.current.takePhoto()
await CameraRoll.save(`file://${file.path}`, {
  type: 'photo',
})

Relevant log output

takePhoto file {
  "isMirrored": false,
  "path": "/data/user/0/com.rn73/cache/mrousavy5871214620613999683.jpg",
  "isRawPhoto": false,
  "height": 3024,
  "orientation": "landscape-right",
  "width": 4032
}

Camera Device

{
  "formats": [],
  "sensorOrientation": "landscape-right",
  "hardwareLevel": "full",
  "maxZoom": 8,
  "minZoom": 1,
  "maxExposure": 20,
  "supportsLowLightBoost": true,
  "neutralZoom": 1,
  "physicalDevices": [
    "wide-angle-camera"
  ],
  "supportsFocus": true,
  "supportsRawCapture": true,
  "isMultiCam": false,
  "minFocusDistance": 10,
  "minExposure": -20,
  "name": "BACK (0)",
  "hasFlash": true,
  "hasTorch": true,
  "position": "back",
  "id": "0"
}

Device

Samsung s10

VisionCamera Version

3.8.2

Can you reproduce this issue in the VisionCamera Example app?

Yes, I can reproduce the same issue in the Example app here

Additional information

@retyui retyui added the 🐛 bug Something isn't working label Feb 6, 2024
@mrousavy
Copy link
Owner

mrousavy commented Feb 6, 2024

Orientation is tracked here: #1891

You're getting width and height in natural sensor orientation. At the moment, proper orientation is not yet implemented.

@mrousavy mrousavy closed this as completed Feb 6, 2024
@retyui
Copy link
Author

retyui commented Feb 6, 2024

well I funded 69$, I hope it might be fixed soon

@mrousavy
Copy link
Owner

mrousavy commented Feb 6, 2024

Thank you! Yea, stability issues are first priority now, then we'll see about orientation :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants