Images are saved the wrong orientation when the option "Save image as previewed" is enabled when using front camera
Hello everyone,
I've noticed a bug within the Camera app of GrapheneOS:
When you use the front camera and enable the option "Save image as previewed", the picture is saved in the wrong orientation (it is rotated to the side).
I also used different Gallery apps but the issue remains. It is NOT the case when clicking on the picture preview within the camera app itself, which is pretty strange somehow.
To reproduce:
- open Camera app
- switch to front camera
- Enable the option "Save image as previewed" (so mirrored)
- Shoot a selfie or another pic
- Go into Gallery app (or any other gallery app) and open the picture
Unable to reproduce. most likely problem is gallery app have you tried google photos app or built-in gallery?
Unable to reproduce. most likely problem is gallery app have you tried google photos app or built-in gallery?
Hello,
that's kinda weird. I will take some screenshots today to show you further.
I tried different gallery apps as well as built in gallery app - it's the same issue..
EDIT: With "Google Photos", the issue is not present! But anyways, it's really strange that any other gallery app has this problem but only if this specific option (Save image as previewed) is enabled.
I don't want to trust the Google Photos app at all to be honest.
Alright so the problem is gallery app or more specifically how "Save image as previewed" feature works. This feature doesn't actually save image as previewed but rather adds metadata about how image is supposed to be previewed google photos app handles this metadata correctly.
Will look into it, Although I don't think can we do anything about it gallery app needs to handle metadata correctly.
I tried different gallery apps as well as built in gallery app - it's the same issue..
I mean build-in gallery in the camera app NOT the bundled gallery app (i am sorry for not being specific the first time) .
I tested few gallery app they don't support ExifInterface.ORIENTATION_FLIP_HORIZONTAL ExifInterface.ORIENTATION_FLIP_HORIZONTAL etc.
Alright so the problem is gallery app or more specifically how "Save image as previewed" feature works. This feature doesn't actually save image as previewed but rather adds metadata about how image is supposed to be previewed google photos app handles this metadata correctly.
Will look into it, Although I don't think can we do anything about it gallery app needs to handle metadata correctly.
I tried different gallery apps as well as built in gallery app - it's the same issue..
I mean build-in gallery in the camera app NOT the bundled gallery app (i am sorry for not being specific the first time) .
Thank you so much! That clearifies my questions completely. So it's not about the Camera app but about the Gallery "interpreting" the pictures, right?
Is there maybe any solution to make it possible for other gallery apps to "understand the metadata better" or interpret it at all?
I tested few gallery app they don't support
ExifInterface.ORIENTATION_FLIP_HORIZONTALExifInterface.ORIENTATION_FLIP_HORIZONTALetc.
But how is it done for usual Camera and Gallery apps? Is it simply saved the right orientation?
Thank you very much sir!
I'm just trying out GrapheneOS on my Pixel 4a and encountered this as one of the first things tested
- Fresh install of sunfish-factory-2024080800. No settings changed.
- Take a picture on the front selfie cam
- Open the the Gallery app (on the home screen): the selfie is rotated the wrong way.
- go back to camera, disable "Save image as previewed" (it was on by default)
- Now pictures taken from the front camera are shown in the Gallery app with correct orientation
It would be nice if the built in app supported this. Where's the upstream for it? I imagine it wouldn't be too hard to patch.
Otherwise, any other recommended app (that is not google photos)?
Edit: Poking around for a few mins, I installed Accrescent from the App Store, then found the one gallery app it had called Aves. It shows the orientation correctly on all the photos.
This is a Gallery app issue, not an issue with our Camera app. Photo viewers need to support the metadata for flipping the images similar to the orientation metadata nearly all support. AOSP Gallery is not actively maintained/developed and we have no intention to do that
@thestinger thanks for the quick reply. If AOSP Gallery is kind of dead, should it just be dropped from being a default app in the install image? Not maintained also increases the surface for vulnerabilities. E.g. recent one with buffer overflow in webp images
The app not being actively maintained/developed doesn't increase the attack surface. It also hardly has any native code. Trying to make it seem like a security problem is wrong. It does still receive security patches but that hardly qualifies as maintenance and it's nearly entirely based on OS code which is where the security patches happen. There's already an issue about replacing the gallery app but there is not a drop-in replacement which exists... so it can't simply be done using a different app.
Thanks, that sounds reasonable.
I found the issue linking it here for reference https://github.com/GrapheneOS/os-issue-tracker/issues/48
FYI we've also encountered issues with latest version of Discord app when using the "Save image as previewed" feature in Camera app and sending the resulting photos to other users. It seems to not support this specific orientation flip EXIF metadata either. It is able to handle rotations normally.