Photos are rotated after saving

Ask for help and post your question on how to use XnView MP.

Moderator: xnview

Octopuss

Photos are rotated after saving

Post by Octopuss »

I have some photos from my phone that display in correct orientation when I open them with Xn, but after let's say I crop them a little and save and reload them, they are suddenly rotated to landscape shape.
Does anyone know why is it happening and what can I do? Are there any settings I missed?
User avatar
xnview
Author of XnView
Posts: 47202
Joined: Mon Oct 13, 2003 7:31 am
Location: France

Re: Photos are rotated after saving

Post by xnview »

could you send me a sample file?
Pierre.
Octopuss

Re: Photos are rotated after saving

Post by Octopuss »

I will when I manage to trigger it again.
I think it only happens with photos from a mobile. Something about the orientation flag getting messed up I believe.
Octopuss

Re: Photos are rotated after saving

Post by Octopuss »

Found one.
The photo was showing correctly until I resized it - then it flipped 90° to the right.
You do not have the required permissions to view the files attached to this post.
User avatar
xnview
Author of XnView
Posts: 47202
Joined: Mon Oct 13, 2003 7:31 am
Location: France

Re: Photos are rotated after saving

Post by xnview »

the file that you sent is landscape
Pierre.
kosmoletec
Posts: 4
Joined: Wed Mar 27, 2019 11:07 am

Re: Photos are rotated after saving

Post by kosmoletec »

I have the same problem. I really like XnView and use it for years but after I started using Mac (OS X) this happens to me all the time and it is extremely annoying.

Steps to reproduce (only on OS X?):
1) Open photo in portrait orientation
2) Make any change (crop, contrast, ...)
3) Save photo
4) Open the photo again - it is in landscape orientation

I usually spend a lot of time by trying to fix this (rotate photo back to portrait and save). Because of the bug it is usually not easy (again rotated back to landscape). Often I have to rotate the pohoto back like 10 times before I finally open it in portrait mode.
User avatar
xnview
Author of XnView
Posts: 47202
Joined: Mon Oct 13, 2003 7:31 am
Location: France

Re: Photos are rotated after saving

Post by xnview »

kosmoletec wrote: Wed Mar 27, 2019 11:22 am I have the same problem. I really like XnView and use it for years but after I started using Mac (OS X) this happens to me all the time and it is extremely annoying.

Steps to reproduce (only on OS X?):
1) Open photo in portrait orientation
2) Make any change (crop, contrast, ...)
3) Save photo
4) Open the photo again - it is in landscape orientation

I usually spend a lot of time by trying to fix this (rotate photo back to portrait and save). Because of the bug it is usually not easy (again rotated back to landscape). Often I have to rotate the pohoto back like 10 times before I finally open it in portrait mode.
could you send me a file to try to reproduce?
Pierre.
kosmoletec
Posts: 4
Joined: Wed Mar 27, 2019 11:07 am

Re: Photos are rotated after saving

Post by kosmoletec »

could you send me a file to try to reproduce?
Here is a photo I opened in portrait mode, changed contrast on it and saved.

Edit: here the picture looks like it actually is in portrait orientation but try to open the picture in new tab or in XnView/any other app.
You do not have the required permissions to view the files attached to this post.
User avatar
xnview
Author of XnView
Posts: 47202
Joined: Mon Oct 13, 2003 7:31 am
Location: France

Re: Photos are rotated after saving

Post by xnview »

kosmoletec wrote: Tue Apr 02, 2019 8:40 am Here is a photo I opened in portrait mode, changed contrast on it and saved.
do you have the original one? the attached file has a bad EXIF orientation field...
Pierre.
kosmoletec
Posts: 4
Joined: Wed Mar 27, 2019 11:07 am

Re: Photos are rotated after saving

Post by kosmoletec »

No, I overwrote original with this one.
I am sending another one - original and saved in XnView after contrast is changed.
You do not have the required permissions to view the files attached to this post.
User avatar
xnview
Author of XnView
Posts: 47202
Joined: Mon Oct 13, 2003 7:31 am
Location: France

Re: Photos are rotated after saving

Post by xnview »

kosmoletec wrote: Mon Apr 15, 2019 8:14 pm I am sending another one - original and saved in XnView after contrast is changed.
I can't reproduce, 'settings>general>Rotate images according EXIF' is checked?
Pierre.
kosmoletec
Posts: 4
Joined: Wed Mar 27, 2019 11:07 am

Re: Photos are rotated after saving

Post by kosmoletec »

Yes, checked. I doubt I changed anything from default settings.
Today I noticed that this bug most likely happens only on pictures bigger than ca. 3 MB. I cannot reproduce it on smaller images.
User avatar
xnview
Author of XnView
Posts: 47202
Joined: Mon Oct 13, 2003 7:31 am
Location: France

Re: Photos are rotated after saving

Post by xnview »

kosmoletec wrote: Sat Apr 20, 2019 6:17 am Yes, checked. I doubt I changed anything from default settings.
Today I noticed that this bug most likely happens only on pictures bigger than ca. 3 MB. I cannot reproduce it on smaller images.
you can ALWAYS reporoduce it on this picture file? could you send me your xnview.ini?
Pierre.
Octopuss

Re: Photos are rotated after saving

Post by Octopuss »

This stuff still keeps happening to me randomly. I'd have a bunch of photos from my phone that display properly, but when I resize them, the EXIF orientation flag is changed (that's what I think is happening).
Of course when I intentionally take a bunch of random photos and try to replicate the problem it doesn't happen.

I'll backup all photos from now on and see if I can find any examples.
User avatar
michel038
XnThusiast
Posts: 1499
Joined: Tue Sep 27, 2016 8:18 am
Location: France

Re: Photos are rotated after saving

Post by michel038 »

Rotate photos is sometimes tricky, because (1)exif tag or (2)embedded thumbnail or (3)preview in cache or (4)full photo, can have different orientations

Select a photo (not fullscreen or display mode, but in the browser) where the problem occurs and try these steps :

- Uncheck "Settings, General, Rotate images according EXIF"
- Uncheck "Settings, Browser, Misc, Change Exif orientation only"
- Rebuild exif thumbnail (Tools, Metadata >)
- Click on "View, Rebuild thumbnails" menu

Now, the photo and its thumbnail have same orientation (check if the view mode or fulscreen show the same orientation)

- If this orientation is wrong, use "lossless rotation" ...
I think the problem should disappear for this photo ?
even if settings are set to their previous value ...
Last edited by michel038 on Tue Jun 08, 2021 1:14 pm, edited 3 times in total.