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

Pictures taken using TakePicture has wrong rotation. #90

Open
Parixit2411 opened this issue Mar 13, 2022 · 10 comments
Open

Pictures taken using TakePicture has wrong rotation. #90

Parixit2411 opened this issue Mar 13, 2022 · 10 comments
Labels
bug Something isn't working

Comments

@Parixit2411
Copy link

Description of the bug

I am using TakePicture to click pictures. Once the pic is clicked it has the wrong rotation. ImageProperties orientation shows unknown.

Reproduction steps

Simply use the TakePicture function with callback parameter and maxSize parameter.

Platform specs

Please provide the following info if this is a Unity 3D repository.

  • Unity version: 2020.3.29f1
  • Platform: Android, not tested on any other platform
  • Device: Nokia 6.1 plus OS 10
  • How did you download the plugin: Asset Store
@Parixit2411 Parixit2411 added the bug Something isn't working label Mar 13, 2022
@yasirkula
Copy link
Owner

Does NativeCamera.LoadImageAtPath also return a Texture with wrong orientation?

@Parixit2411
Copy link
Author

Yes, LoadImageAtPath is also returning texture with the wrong orientation. I have tested it on one other device and it is working fine on it. So I think it might be on Android OS 10 or my particular device.

@yasirkula
Copy link
Owner

I'd like to believe that it's a device-specific issue. If it were an Android 10 issue, I think other similar issues would've arrived by now. Could you replace NativeCamera.aar with the one inside this zip archive and see if it resolves the issue on the problematic device?

@Parixit2411
Copy link
Author

Alright, I will use that and check.

@ernonemacher
Copy link

Facing the same issue, replacing the NativeCamera.aar didn't change anything. ImageProperties orientation returns Rotate180.

I am testing in a Redmi Note 8, Android 10.

@Parixit2411
Copy link
Author

As far as I have tested, it happens on some devices with Android 10. So as mentioned earlier, it might be a device issue. Maybe you should try to test it on another device.

@yasirkula
Copy link
Owner

yasirkula commented May 20, 2022

@ernonemacher If you save the image to Gallery with NativeGallery, is it displayed correctly there? If it does, does loading the image from gallery with NativeGallery.GetImageFromGallery and NativeGallery.LoadImageAtPath return a correctly oriented Texture?

P.S. You may also use the device's file browser to preview the image file directly. It should be located inside temporaryCachePath which is located inside storage/Android/package_name/cache.

@ernonemacher
Copy link

Thanks @yasirkula for your support, it worked. I was using File.ReadAllBytes, changing to NativeCamera.LoadImageAtPath worked. It wasn't necessary to save the image in the gallery.

@Parixit2411
Copy link
Author

Parixit2411 commented Oct 11, 2022 via email

@yasirkula
Copy link
Owner

@Parixit2411 Can you replace NativeCamera.aar with the one inside this zip archive and paste the logcat logs that start with "===" after taking a picture with the camera?

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

3 participants