Default camera opens oldest image when opening gallery from it, instead of latest image

Hello everyone!

I am using the default camera because I quite like its UI and settings, but I am having a small issue. I am also using Fossify Gallery as my default Gallery. When I click the thumbnail in the bottom right of the camera app, instead of showing me the latest picture taken it takes me all the way to the first video I took when I got the phone and I need to swipe a lot to get to the picture I just took. I tried installing Fossify Camera as well as PhotonCamera and they both have the correct behaviour (tap thumbnail, opens default gallery app on latest picture/video). I tried looking in the settings but I didnt find anything. Is there a way to fix this? It seems really silly, especially for someone who takes a lot of pictures or has the phone for many years.

Thanks in advance!

I’ve seen this mentioned before, but doesn’t come up often. The second item has linked code with a comment intro explaining the fallback mode: no exif → last_media_scanned_check_uri. I get lost when looking at the function that calls broadcastFile() that eventually calls setLastMediaScanned() what is what you get when clicking/touching the preview. I wonder if the behaviour changes if you disable/enable storage access framework (“SAF”).

It seems like thats something in the codebase, which is not something im prepared to even look at at this time :joy:

I was looking more for a setting I can easily change tbh

SAF is a setting that influences the behaviour, it’s in

Settings upper right → … More camera controls…" → scroll to middle → Storage Access Framework (off/on)

Do you have multiple videos recorded? if there’s only one, “last media scanned” could be still a first and last VID_, because by alphanumeric ordering it comes after IMG_

Edit: gave my own links a re-read, the poster points out with SAF the behaviour to the end-user is indeed correct, though you loose the delete option?

I found the Storage Access Framework setting but from what I read of its description and what I can tell that is just about saving media to other locations e.g. an SD Card. When I click it to toggle it on it opens my file manager with the prompt to “Use this folder”. Is that really related to my issue?

As for the alphanumeric sorting, I still feel it should be irrelevant for this scenario. If I take anything, whether it be an image or a video, and I immediately click on the thumbnail to open the gallery and preview what I just took, I expect it to be already selected. It should sort by date of creation, not by alphanumeric based on its file name.

SAF is a file access abstraction, allowing for both narrower scope and allowing other apps to provide data/files. How it handles external storage is a by-product.

The code that handles the preview image is littered with checks for SAF enablement and behaves different implicitly. There’s one user report that came back positive that it fixed opening an older file instead of the last taken - that’s all I can offer