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

Sort by date doesn't work properly. #1427

Closed
ZornHadNoChoice opened this issue Feb 11, 2025 · 4 comments
Closed

Sort by date doesn't work properly. #1427

ZornHadNoChoice opened this issue Feb 11, 2025 · 4 comments
Labels
type:bug Something isn't working

Comments

@ZornHadNoChoice
Copy link

Describe the bug
It seems like sort by date order has a resolution of seconds.
I have generated many images with code and the difference in creation date between two consecutive images might be less than a second but it's not 0. I think that Aves treats them as having the same date and sorts them alphabetically.

To Reproduce
Steps to reproduce the behavior:

  1. Get some images with the same creation date modulo a few microseconds.
  2. They will not be sorted correctly.

Expected behavior
The app (at least internally) should use microseconds to sort images.

Screenshots
Correct sorting on the right.

Image

I'm not sure if downloading these images changes their creation time, but in case it doesn't here are two images to test (you can see the correct order above):

Image
Image

System information and logs:
aves-logs-20250212_015203.txt
Package: deckers.thibault.aves.libre
Installer: org.fdroid.fdroid
Aves version: 1.12.3-libre, build 14302
Flutter: stable 3.27.4
Android version: 13, API 33
Android build: TKQ1.220905.001 test-keys
Device: Xiaomi 23013PC75G
Display: pixel ratio=3.5, logical=411.42857142857144x914.2857142857143, physical=1440.0x3200.0
Support: dynamic colors=true, geocoder=true, HDR=true
Mobile services: not available
Connectivity: wifi
System locales: en_GB
Storage volumes: /storage/emulated/0/
Storage grants: /storage/emulated/0/Pictures/, /storage/emulated/0/DCIM/
Error reporting: false

Additional context
My default gallery app (shown above) sorts them correctly.

@ZornHadNoChoice ZornHadNoChoice added the type:bug Something isn't working label Feb 11, 2025
@deckerst
Copy link
Owner

I'll take a closer look tomorrow, but in the meantime I'd like to point out that Aves favours metadata dates, and uses file dates only as a fallback. As I remember, metadata dates (in EXIF and XMP) can have subsecond resolution, if the fields are provided. Otherwise, if you rely on file dates, it's available for media via this field, which is in seconds. Anyway, relying on file dates is a bad idea. The "creation date" you mention is in the Exif, with the subsecond field?

@ZornHadNoChoice
Copy link
Author

umm, how to say this? I'm nothing but a novice programmer. In other words, I didn't understand your points/don't know about those EXIF things!

@deckerst
Copy link
Owner

I've fixed the precision of the file modified date, but you shouldn't rely on it anyway. If you move files to another device (or for many other reasons), the date will change. Rely instead on metadata dates. You can search for Exif, etc. It's not a programming thing, it's just metadata formats.

@ZornHadNoChoice
Copy link
Author

Thanks.

You can search for Exif, etc. It's not a programming thing, it's just metadata formats.

Noted. I'll try to find a way to change the metadata.

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

No branches or pull requests

2 participants