Not logged in. · Lost password · Register
Forum: General Help and Support Installation and Configuration RSS
Unintended image rotation
Images come out rotated when they shouldn't
Avatar
catdude #1
Member since Apr 2019 · 1 post
Group memberships: Members
Show profile · Link to this post
Subject: Unintended image rotation
I'm using Media Manager to upload and create links to jpg files. If my image files are wider than they are tall, they are shown just fine. If they are taller than they are wide, they appear rotated 90 degrees. I looked through the available config settings and didn't find anything that would explain this.

Did I miss something, or misconfigure something?
Avatar
pop (Moderator) #2
Member since Nov 2016 · 207 posts · Location: near Basel. Switzerland
Group memberships: Global Moderators, Members
Show profile · Link to this post
The fault could lie with the images.

Some cameras produce funny metadata for rotated images. Mine, for instance, indicates that the image should be rotated, but the number of pixels given for the width is still greater than the height.

This causes programs to display the image inconsistently. My DokuWiki, for instance, shows the preview for those images in landscape orientation but the full image is shown in portrait orientation, as it should.

I can observe this behaviour with images made with a Leica.
Avatar
schplurtz (Moderator) #3
Member since Nov 2009 · 493 posts · Location: France, Finistère
Group memberships: Global Moderators, Members
Show profile · Link to this post
In reply to post #1
I guess some of your photos were taken with the camera rotated... jpeg image can include an exif orientation instruction. Obviously, something gets confused by this instruction. See https://forum.dokuwiki.org/thread/14047
Avatar
markchagers #4
Member for 2 months · 1 post
Group memberships: Members
Show profile · Link to this post
I seriously doubt this, I have an image taken with an iPhone in upright position, with the camera set to square image. When uploaded to my dokuwiki the image is rotated left. If I crop the photo so it's wider than high the rotation is ok.
The dokuwiki is the only site I have ever seen showing this behaviour. Apparently the rotation as set by the iPhone camera is ignored, and only the image dimensions are taken into account.
Avatar
schplurtz (Moderator) #5
Member since Nov 2009 · 493 posts · Location: France, Finistère
Group memberships: Global Moderators, Members
Show profile · Link to this post
What is it you actually doubt ? That there is an orientation instruction in the EXIF data ? that "something gets confused" in the process ?
I don't take picture with my phone, so I can't know, but here is what I guess : The usual way to take a photo is to hold the phone horizontally; ie "normal", or "non rotated" photos are wider than high. So when you take a picture with your phone upright, the phone is actually rotated. The fact that you set the photo to square is irrevelant; what matters is where the sky and the ground are. You could set your phone to take round photos, there would still exist an up direction and a down direction. You simply are not aware of this  because both your phone and your computer are smart enough to show you the photo in the correct orientation. So, you take a photo with a rotated phone and upload it to DW; the photo has the rotation instruction since your phone was rotated. If you don't resize the photo, DW will serve it unchanged to your browser. It seems your browser does not honor the rotation instruction of the photo; you don't see what you expect to see : the photo is rotated. When you crop the photo, your cropping software understand the rotation instruction, so it rotates the photo before it manipulates it, and when it creates a new file, it just writes a standard, non rotated, photo (why would it re-rotate tne image and set the rotation instruction ?). Of course, all this is only a guess. The only way to be sure is that you post here the relevant exif metadata of the unmodified photo, and of the cropped photo.
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Go to forum
Imprint
This board is powered by the Unclassified NewsBoard software, 20150713-dev, © 2003-2015 by Yves Goergen
Current time: 2019-11-18, 18:56:14 (UTC +01:00)