Hi,
The listing of objects is using the Amazon S3 API as outlined here https://docs.aws.amazon.com/AmazonS3/latest/API/v2-RESTBucketGET.html
When building the plugin, I didn’t see anything in relation to sorting by date, so I think you would need to use a naming/keyspace scheme that will sort lexicographically for your needs, as that seems to be the only way the sorting is handled on the S3 side.
Amazon S3 lists objects in UTF-8 character encoding in lexicographical order.
Another option would be to being back all the images and sort them using Lua against the timestamp returned. But again, depending on how many images you would end up returning, you would still probably need to come up with a naming/keyspace scheme so you don’t bring back all images, which could produce a heavy network load depending on the amount of images.
You could store the image paths in a database, which would then make it trivial to get the sorting you want, but of course that adds an extra layer of complexity. Coronium Core is a fairly simple solution for database needs if you want to go that route. Or you can roll your own as Core might be more than you need.
It’s certainly disappointing from the S3 side that there are not better sorting options.
Thanks for using the plugin!
-dev