Page 1 of 1
sort by exif field date time taken
Posted: 16 Jan 2021, 23:50
by OlivierToebosch
Hello, I intend to give some users the possibility to upload images. Several people, same event.
i'd like to have the gallery show the images intermingled, in the right historic order, when different people do an upload. either I missed this somewhere but, I cannot see how I can sort on the exif fields.
thx for the tips!
Best regards, Olivier
Re: sort by exif field date time taken
Posted: 17 Jan 2021, 22:36
by Jan
Hi, sorting is based on database items. So date is a date of upload/add to the system. Setting date base on EXIF needs to be customized directly in the code
Jan
Re: sort by exif field date time taken
Posted: 18 Jan 2021, 13:46
by OlivierToebosch
So, if I understand and read between the lines here, altough the data is available in the image file, it is not possible to sort on it.
Can I add a field to an image record?
Can I fill this field with an exif field (by other means obviously). Maybe through a sql query...?
Can I use that added field as sorting field?
thx Jan!
Re: sort by exif field date time taken
Posted: 18 Jan 2021, 16:59
by Jan
Hi, generally (not only applied by Phoca Gallery), when you ask data from database, then you define the sorting and your database will return you the data from database sorted by defined sorting. This has nothing to do with the files on your server, it is just about database.
So if you want to order/sort by date set in filename, you need to move this to database record, for example:
- when image is uploaded to your server
- you will read the date from exif
- file is stored on your server and the item is stored in database (and instead of "now" date you will use the date read from the file when storing data to database)
So when you want to order by date set in EXIF of the file, you need to read it and store to database because as default data from EXIF or form file itself are not stored in database, they are inside the filename. In database you have all the aditional data - title, alias, date, ...
And as it is not so easy, Phoca Gallery has independent database and filesystem layer, becaust it can happen, that you have two images e.g. in two different categories but both of them use the same original file on the server.
Jan
Re: sort by exif field date time taken
Posted: 20 Jan 2021, 13:55
by OlivierToebosch
Maybe I should just ask the users to rename the files according to dateTime taken from exif.
Thx
Olivier
Re: sort by exif field date time taken
Posted: 21 Jan 2021, 13:37
by Jan
Yes, if the format will be right, you can then sort by title which in fact will be the same like by date.