I have uploaded several tens of GBs of photos onto my NextCloud server. The Photos app, as well as the Files app show the photos not rotated according to EXIF data, but some are 90deg off.
I noticed today that I was missing PHP exif-extension, so I installed it. Now when I upload new photos, the EXIF data is properly read and the photos show up in correct rotation.
BUT: is there a possibility to re-scan the photos somehow to make EXIF data effective for the photos which are already on the server? Or do I really need to re-upload them all to have the EXIF scanned?
I tried already
occ files:scan-app-data
occ files:scan
but these did not have any effect for the photo orientation.
Thanks @just for the Photoprism hint. Just playing around with it a bit. How does it support Nextcloud?
I usually run Lychee on my Nextclouds as a public frontend for picture and video website for partners and customers. Lychee just imports the original nextcloud files as a folder synch and does not store the pictures or videos on its own then, just a few little previews.
Photoprism cannot read my “Library”. Is there a deeper nextcloud integration or am I missing some rights/setup details?
Thanks for the hint @just !
I abandoned Dav a bit, since it is not really usable on Windows machines when the files are bigger than 4GB. I mostly have bigger files here, ie clips with 600Mbit. Once they are on the nextcloud, it is easy to synch them into Lychee.
I also use the Lychee web interface to hand over those files to partners, clients and other professional productions. It simply looks more beautiful and is super nice to operate and hell fast. You can import a local folder (ie /var/www/nextcloud/data/axel/files/Photos) super quick and I do not have to play around with any folder or file rights, nor with the owner (www-data). It also does not need a docker and runs in parallel to Nextcloud on the same Apache2. Simple and beautiful
Still, I will try the PhotoPrism a bit, seems to have some nice features.
Just tried the rescan and no photos were rotated on rescan, as their rotation is still wrong when viewing in Photos app.
# sudo -u wwwrun php occ files:scan --generate-metadata --all
Starting scan for user 1 out of 3 (xxxxx)
Starting scan for user 2 out of 3 (yyyyy)
Starting scan for user 3 out of 3 (zzzzzz)
+---------+-------+--------------+
| Folders | Files | Elapsed time |
+---------+-------+--------------+
| 91 | 5261 | 00:26:25 |
+---------+-------+--------------+
To me it seems ExifProvider.php only handles GPS and image size, not the rotation. So was there even a possibility of the rotation via re-scanning to work to begin with?
It boiled down to not be an actual EXIF data issue, but actually about the previews. I did not have PHP EXIF-module installed when first uploading the photos, so the preview generation did not rotate the images properly.
What I needed to do eventually was this:
stop Apache2
remove /appdata_*/preview/ folder (just the preview!)
run: occ files:scan-app-data
start Apache2
(Clear the browser cache of my Nextcloud site data)
Now my preview images are in correct rotation.
(Although configured for too big size as default, so need to modify the config and run again, maybe. Or try the Previewgenerator app)