Mobile image upload turns sideways


#1

Hi there, since a week or so we’re experiencing trouble with images uploaded from mobile phones. As can be seen below they turn sideways.

Can anyone explain why this is occurring and/or fix this issue?


Is there a way to manually rotate an image
Orientation of images uploaded is wrong
Is there a way to manually rotate an image
Is there a way to manually rotate an image
(Jeff Atwood) #2

This depends on the platform / browser – images store metadata about orientation in them, and that orientation data may or may not be honored by the viewing platform / browser.

It is possible to strip the metadata, but I can’t recall seeing any badly (incorrectly) oriented images on any device recently. Can you upload one of the problem images here to this topic?


#3

Hi Jeff, thanks for your reply. This is an image directly uploaded through the camera upload function.


#4

I use a Samsung S8 with its latest android version. Browser is the native Chrome browser. No tampering has been done to the image meta whatsoever. These are the steps I took:

Select upload
Select camera
Snap picture in upright position
Hit reply


#6

Hi @codinghorror , it’s been a while and we are still experiencing this annoying ‘feature’. Is there any news from your side?


(TomG) #7

I don’t seem to be abel to see any EXIF info for the uploaded image, perhaps something strips it out when embedding in the topic. You could try uploading the original to an online EXIF editing site like the one below and seeing what it says in the “Image Orientation” section?

https://www.imgonline.com.ua/eng/exif-editor.php


#8

Shooting a new pic for testing (samsung s8)


#9

Testing on samsung note 3


#10

Testingen on Huawei Nexus


#11

Testing document upload from s8


(Joffrey Jaffeux) #12

Just to be sure, can you confirm that each of these images have been taken from a phone and directly uploaded to this post, without any other app or tool used between?


#13

Hi @joffreyjaffeux , all were directly uploaded to the post. Except for the last one which was first taken, then uploaded as a file. No altering with third party apps though. I understand the image orientation remark by @hutchinsfairy, but somehow my Dropbox camera upload has no trouble storing the pictures in the correct orientation.

It does seem a phone type/brand thing seeing the Nexus did get it right…


#14

@hutchinsfairy

This is the exif result. And indeed the image orientation gets rotated… What an odd thing.

Is there any way for our forum users to counter this?


(TomG) #15

I think the orientation metadata is set by the device as you take the photo, so any real solution would have to be at the device level.

Workarounds would include editing either the metadata or the the image directly before upload but that’s no fun for anyone.

Ignoring the metadata would probably upset more users than it helped, even if there was appetite to make that change in Discourse.

It might work to lock the orientation of the device itself before taking a photo. If you can find a solution that works for your device then you might be able to provide a HowTo for other users.


(TomG) #16

Bit more googling suggests that Samsung devices handle rotated images differently, although I haven’t found a good source to confirm.

Seems like non-samsung devices might handle image orientation by simply switching X and Y, i.e. actually taking a landscape image as landscape.

Samsung devices apparently take all images with the same X and Y and then tag landscape ones with the relevant EXIF info.

So it seems like the issue here is actually a Discourse one as it really should be honouring EXIF orientation metadata.

@Roy_ILGM if you could post the same S8 image twice, once with untouched EXIF and one with the Image Orientation field set to blank then that might be proof enough to ask for it to be looked at.


(Joffrey Jaffeux) #17

@Roy_ILGM can you upload an unaltered image on s3 or something like this so we can reproduce this easily ?


#18

@joffreyjaffeux @hutchinsfairy


(Joffrey Jaffeux) #19

no it’s not what I mean :slight_smile: you need to upload it outside of discourse and give us the url please.


#20

For this one I “emptied” the image orientation field using Edit EXIF, IPTC, XMP data in JPEG photo online - IMG online


#21

@joffreyjaffeux And here’s one I uploaded to google drive from my device

https://drive.google.com/open?id=0B_oW0mBNwjf4MThGODFpQ3lPaG8