Comments (42)
Could it simply be sorted by the name as a start ? With current cameras naming convention, the filename reflects the creation date order.
from photos.
@jancborchardt You're right. However, it is not better now, because currently the order is completely random as I transfer my picture using scp
. That is why I was saying "as a start". I prefer to have 2 sets of photos ordered than nothing coherent.
from photos.
Hi @skjnldsv,
For me all photos are being displayed in an incorrect order as they all have been modified sometime.
So changing that line that I mentioned helped me to fix part of the problem, I understand that a File can have a creation date different from the photo that it represents, but that seems to be more uncommon than having a modification date and everything listed by that modification date.
from photos.
@jancborchardt shall we use creation date by default instead of last modified?
Yep! :)
from photos.
@frieck this suggest is about the taken date, not the creation date of the file.
So we'd need exif support
from photos.
Could it simply be sorted by the name as a start ? With current cameras naming convention, the filename reflects the creation date order.
This would break down as soon as you get photos from a second camera or from friends, or the numbering of your own camera wraps โ so the current way is better for now. :)
from photos.
Is anyone working on this already? @skjnldsv @jancborchardt Maybe if there's a PR started I could help.
from photos.
BTW, there's this application gino0631/nextcloud-metadata which can already extract metadata of many formats. Is there a way to use that? @Mikescops @skjnldsv ?
Like mentioned on this thread and others multiple time, this require metadata to be merged and shipper into nextcloud server, available through dav and have a dedicated API for other apps.
Then it would be a few lines of code for the Photos app.
from photos.
Why is this still a thing?
I want to switch to Nextcloud from Google Photos, means I did a full Google Export and uploaded the around 100.000 files to Nextcloud just to figure this out.
When will you change this?
from photos.
It would be a nice enhancement.
But we currently do not store the taken date
cc @rullzer
from photos.
cc @jancborchardt if it make sense
from photos.
Yep, very good point โ for photos it absolutely makes sense to sort by taken date, exactly for the reasons @tillwf mentioned. :)
from photos.
I'd rather have modification date (like all mobile galleries work) than name
from photos.
Guys, can't we just change this line
photos/lib/Controller/AlbumsController.php
Line 102 in c993c63
to use
$node->getCreationTime()
?That makes picture be displayed in a more logical order....
from photos.
@frieck not arguing with your specific issue :)
It fits some people use, but also not for others. Just reminding that this issue is about the photo taken date, not creation date.
Could the creation date be the default info used ?
Nonetheless, I just notice this line on the main post, which make this confusing ๐
@jancborchardt shall we use creation date by default instead of last modified?
from photos.
creation date of the file is better than the mtime, but EXIF data would ofc be best. Unfortunately, creation date (filesystem level) is also of no use if you use the NC app to sync your pictures from the phone, since all files end up with a creation date of the time of the upload :(
from photos.
@skjnldsv considering the amount of discussion and also the pitfalls you mentioned in your comments, this does not seem like a good first issue?
from photos.
@skjnldsv considering the amount of discussion and also the pitfalls you mentioned in your comments, this does not seem like a good first issue?
You mentioned created date, which we have. For exif taken date of course this is not a good first issue. :)
There is another issue laying around somewhere that is also similar iirc
from photos.
Hi,
I would also like to sort photos by taken date, rather than last modified date, for the same reason : I have different photos, taken by different devices, covering the same event, and I would like to see them all in chronological order.
I'm new to Nextcloud, and I have a fairly limited experience with php, but I figured I could prototype some temporary function using php built-in EXIF support:
function getOriginalDate($nd) {
$filename = $nd->getPath();
$filebase = $nd->getName();
if ($filebase == "." or $filebase == ".."){
return 0;
}
if (exif_imagetype($filename)) {
$exif = exif_read_data($filename, 'EXIF');
if (is_array($exif) || is_object($exif)) {
foreach ($exif as $key => $value) {
if ($key == 'DateTimeOriginal') {
return strtotime($value);
}
}
}
}
return $nd->getMTime();
}
and then in photos/lib/Controller/AlbumsController.php:
'lastmod' => getOriginalDate($node)
This way, if the photo has EXIF entries I can use them, otherwise use last modified entry.
But sadly it didn't work.
So I tried to force set all modified date to EXIF taken date if available using EXIF-Tool
for i in *.JPG;
do
echo Traitement de $i
touch -t `exiftool -s -s -s -d "%Y%m%d%H%M.%S" -DateTimeOriginal $i` $i
echo `exiftool -s -s -s -d "%Y:%m:%d %H:%M:%S" -FileModifyDate $i`
echo ""
done
exit 0
But although the code ran, and the files seemed to have been modified, nothing changed when I displayed the album in Nextcloud.
I know the cleanest method would be to handle this server-side but I can't figure out what went wrong with my attempt.
Regards,
J-C
from photos.
Hi @skjnldsv,
For me all photos are being displayed in an incorrect order as they all have been modified sometime.
So changing that line that I mentioned helped me to fix part of the problem, I understand that a File can have a creation date different from the photo that it represents, but that seems to be more uncommon than having a modification date and everything listed by that modification date.
Does this require a "rescan" or should it work out of the box?
from photos.
But although the code ran, and the files seemed to have been modified, nothing changed when I displayed the album in Nextcloud.
@jcclerval , belief is that you'd need to run re-scan at least on that folder where photos are.
The best would be to have your approach implemented, meaning:
a) try to extract EXIF picture taken timestamp (normalize to UTC) and display either at presentation layer translated to local one or use timezone as in EXIF,
b) check if file naming convention doesn't reveal YYYY-MM-DD or something similar (trick is to small amount of files is available, i.e. what means 2020-01-01 - for most of Europeans it would be Jan 1st, but not necessarily for everyone),
c) if nothing of above gives good result, use file timestamp (last resort).
This would need to be stored somewhere in a table, probably together with other EXIF related details, like GPS, etc.
This opens nice avenue for presentation layer.
from photos.
Indeed, I ran a re-scan and now it works ๐ (although it only was the original code with altered last modification date, now I'll try to check the piece of code with non-altered photos)
from photos.
I think it would be useful to have an option to set cdate of photos to exif DateTimeOriginal and sort photos by cdate. In my opinion, this feature is very important to the photos app as users expect photos to always be sorted by the date they were taken.
from photos.
@Zaijo hi, right now no one seems to be working on this โ if you want to dig into the code that would be great! @skjnldsv @Mikescops will be able to help with any questions. :)
from photos.
OK, how can we communicate about this? Do you have a chat or developer forum somewhere? I need help.
from photos.
BTW, there's this application https://github.com/gino0631/nextcloud-metadata which can already extract metadata of many formats. Is there a way to use that? @Mikescops @skjnldsv ?
from photos.
@Zaijo I am also interested in helping out with this one. Let me know.
from photos.
I'm sorry guys but in between I found Photoprism https://docs.photoprism.org/ which I now use alongside with Nextcloud and this EXIF way for Nextcloud Photos seems to have a veeeery long path before it's usable for me.
from photos.
@Zaijo , did you use some guide to install photoprism and set it up with nextcloud? This sync-option looks like it duplicates the image data (?) https://docs.photoprism.org/user-guide/settings/sync/
from photos.
Let's move to e.g. Twitter with that so we don't spam this thread. https://twitter.com/zaj0
from photos.
I reckon it will take some time before it is properly managed server-side. How about some partial temporary feature using PHP built-in EXIF support ? Something similar at what I have written above, but better and at the right place ?
from photos.
No, it must be done right or none at all. Temporary hackish features are what got us in lots of trouble in lots of areas. And then no one maintains it, and it suddenly becomes the bottleneck for any desired changes. ๐
Locking this thread, nothing more productive seems to be added, you are all free to start working on this and I will help you implement it if you do. ๐
from photos.
@marcelklehr
How hard is it to fix this issues when nextcloud/server#30366 will be merged?
from photos.
Shouldn't be too hard, IMHO. One problem is that file creation dates are a relatively recent addition to the linux family so may not always be available...
from photos.
@artonge what do you think about this one regarding feasibility? Would it need EXIF data to be saved or something else as prerequisite?
from photos.
This would need the EXIF data to be saved in the oc_file_metadata
table. Easy. But this would also need to be able to order files with on a metadata entry. Harder as there is no logic for that yet. I did not event looked at it, so not even sure that is possible, but I hope it is.
from photos.
Whatโs the current state or feasibility regarding this now that we have the data in the metadata table (right?) โ @artonge?
from photos.
Looks like this would need to be first done by the desktop and other client apps?
See nextcloud/server#30366 (comment)
from photos.
cc @tobiasKaminsky also for the client part as mentioned by @szaimen.
from photos.
This would need the EXIF data to be saved in the
oc_file_metadata
table.
This is only on server.
On clients there is no reliable way to check/send creation date.
from photos.
Whatโs the current state or feasibility regarding this now that we have the data in the metadata table (right?) โ @artonge?
I do not think that we have the data yet.
from photos.
So I guess we would need to extract the information on server and store it in the metadata table first?
from photos.
Related Issues (20)
- NC 28.0.x - External folders are not scanned for new media. HOT 3
- Failed to update nextcloud/ocp package on branch stable27
- [Bug] Photo stream month titles are not localized in Chinese (Simplified)
- Failed to update nextcloud/ocp package on branch stable27
- "No photos or videos in here" since latest 29 beta, still present at RC1 HOT 4
- Failed to update nextcloud/ocp package on branch stable27
- [Bug]: No longer able to add additional Photos to Album after creation HOT 5
- Failed to update nextcloud/ocp package on branch stable27
- Failed to update nextcloud/ocp package on branch stable27
- AlbumMappper::getForFile is not using an index
- Add owner, file_id index to oc_photos_albums_files
- Videos No Longer Showing Up
- [Feature Request] Set Default View for Public Share Links to โGridโ for Photos
- Failed to update nextcloud/ocp package on branch stable27
- Nextcloud:29.0.0 Unable to edit photos; redirected back to the file list HOT 8
- Failed to update nextcloud/ocp package on branch stable27
- Galery preview "jumping" on larger folder HOT 1
- Failed to update nextcloud/ocp package on branch stable27
- Allow sorting & reordering of pictures in galleries
- Allow adding to gallery from folder view HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from photos.