How to fix unexpectedly rotating image files uploaded to Nextcloud?

Reading Time: 2 minutes

I fixed not to rotate image files uploaded to Nextcloud.

You just need to install exif extension.
Nextcloud will automatically use exif information and rotate proper orientation.

This is which I referred.
Thanks a lot!

Photos do not get rotated correctly (EXIF tags) · Issue #839 · nextcloud/server
Steps to reproduce Take a photo with a phone held upright (I used a Jolla phone) Upload the picture to Nextcloud Expected behaviour The picture should look upri...

This is my git commit.
Please refer for more detail.

Added exif extension for correct orientation of image file. · kurofuku/nextcloud-container-fpm@d293272
Contribute to kurofuku/nextcloud-container-fpm development by creating an account on GitHub.

I changed to use php:8.0.15-fpm-buster because latest tag will use upper PHP version than Nextcloud supports which is 8.0.
This isn’t related to this post so you may skip it.

This is before fix.
Some image is rotating…

This is after fix.
Beer/wine orientation is good!

You will need to create preview thumbnail again if you already created.

You can refer this post how to create again.


How was it?

You won’t be irritated when you see photoes!


I am Japanese software engineer having over 15 years career in embedded system software.
I have worked for designing/quality assurance products which has embedded linux.
I love Raspberry Pi.
I am also interested in stock market.
I married Hong Konger as international marriage.

Please follow me
Please follow me
The World's Linux Journal