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

CameraX wrong image orientation #74

Closed
Holoceo opened this issue Oct 1, 2019 · 11 comments
Closed

CameraX wrong image orientation #74

Holoceo opened this issue Oct 1, 2019 · 11 comments

Comments

@Holoceo
Copy link

Holoceo commented Oct 1, 2019

When I take a picture in CameraX sample with LensFacing.FRONT it is displayed correctly in photo screen, but other apps shows it rotated by 90 degrees clockwise.

Orientation is correct for LensFacing.BACK

Should there be specific meta data?

One Plus 5, Android 9.0 (OxygenOS 9.0.8)

@owahltinez
Copy link
Contributor

It sounds like the other apps are not reading the EXIF metadata properly. Do you know what is the package name of those other apps? Is there any way for you to submit a bug report to them?

@Holoceo
Copy link
Author

Holoceo commented Oct 2, 2019

Google Drive displays this image even upside down. However preview is good.

@owahltinez
Copy link
Contributor

So the preview in the Google Drive app appears correct, but after you open the file it shows upside down? That's a good one. What version of the app is this happening on?

@Holoceo
Copy link
Author

Holoceo commented Oct 2, 2019

Yes. The version is 2.19.352.03.40

@owahltinez
Copy link
Contributor

You should be able to file a bug for Google Drive by going to the hamburger menu > Help & feedback > Send feedback.

Developers can modify the images if they choose to in their apps, CameraX only adds the EXIF metadata and tries to stay away from modifying the pixels of the camera frames.

@Holoceo
Copy link
Author

Holoceo commented Oct 2, 2019

Ok, but looks like there are no apps that honor EXIF. Even instagram, whatsapp, telegram, file chooser, gmail attachment preview... I haven't found an app which displays this picture correctly.

@owahltinez
Copy link
Contributor

This is good feedback, and maybe at some point we should consider that maybe it's us who are doing it wrong and not everyone else. I encourage you to start a conversation with the team directly at https://g.co/camerax/developers.

It doesn't help that Android's Bitmap factory libraries all ignore EXIF metadata and developers have to load yet another library to do the right thing. Developers that use Glide should be getting the images with the correct orientation by default.

@IhwanID
Copy link

IhwanID commented Oct 3, 2019

I have some issue.

@inludese
Copy link

I have the same issue.
Preview looks good for LensFacing.FRONT and LensFacing.Back, but all stored images have landscape orientation if I open it in Android Studio.
After I stored images on Mac, every image have portrait orientation. ( portrait or landscape orientation of device did not affect output image at all)

Device: Pixel
OS Version: Android 10

@owahltinez
Copy link
Contributor

Thanks @Holoceo for opening up the discussion at the forums. For everyone's reference, here's the thread where you can engage directly with the engineering team and ask for a fix: https://groups.google.com/a/android.com/forum/#!topic/camerax-developers/NqZG8Bt4iOg

I'll keep this issue open so people can find it and get some context, but currently it is not actionable since we don't want to rotate images in the sample -- at least for the time being.

@owahltinez
Copy link
Contributor

Actually, this issue will show up from Google Search even if it's closed. Closing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants