Your comments

I haven't thought about the performance issue.

A possible solution would be to turn it within the browser, with a small JS script: (for this to work, you will probably need to load it on js and then set the background-image attribute, like this:

I would recommend setting a `data-exif-orientation` attribute based on the result of the call and let the CSS rotate the background using `transform` depending on this `data-exif-orientation` attribute.

I totally understand your point (I am now using ImageMagick on my installation :-).

With ImageMagick activated, all the thumbnails are fine.

However there are still some issues:

- on a shared folder gallery: the fullscreen view is not rotated at all (expect on firefox when I manually add `image-orientation: from-image`)

- on my own gallery, the preview is not rotated

- on my own gallery, the zoomed view is not rotated

This answer seems like a nice trick: (PHP + CSS cooperation)

I confirm that the sorting of the gallery is a bit exotic.

Example on (folder HOME/Photography), if you share it with a "grid view", the pictures appear in alphabetical order. If you share it with "Image gallery" the order seems to be random (