Jpeg rotation query
Author
Discussion

mojitomax

Original Poster:

1,876 posts

221 months

Tuesday 23rd August 2011
quotequote all
Hi folks, not sure if this should be here or in computing.

when i take a pic from my iPhone camera the iPhone senses in which orientation it is held whilst taking the picture and applies a rotation tag to the jpeg. so on my computer (MacBook) it is the 'right way up'. i think my canon slr also does this. Great, i don't have to derotate pics.

however, i was uploading the pics to my web host straight from the iPhone (i emailed the pics to myself and uploaded these) so that i could post them in another thread. when i linked to the images they were in their 'raw/native' orientation - i.e upside down even though they looked fine on the MacBook.

i solved this by exporting the original jpeg to a png and then exporting that back to a jpeg and uploading this new jpeg in the correct orientation. is there a way of resetting or changing the rotation tag on the original jpeg so i don't have to go through this export step?

i hope i explained it well enough.

thanks for your help

rxtx

6,050 posts

239 months

Wednesday 24th August 2011
quotequote all
The orientation info is stored in the EXIF data, the host must be stripping all or certain EXIF tags. Nothing you can do about it unless there's an option to prevent that, aside from rotating them yourself.

ETA, Thinking about it, only an application will rotate an image based on EXIF, a web browser probably won't, I've just tested with Firefox and added an Orientation tag to a JPEG and while Preview rotates it, Firefox shows it as it was taken. Some hosts could be smart and look for that tag and rotate on upload.

Edited by rxtx on Wednesday 24th August 12:36

Mr Pointy

13,361 posts

188 months

Wednesday 24th August 2011
quotequote all
I'm pretty sure Irfanview will do it. I came across this some time ago & never realised how complicated it could be:

http://www.impulseadventure.com/photo/exif-orienta...

mojitomax

Original Poster:

1,876 posts

221 months

Wednesday 24th August 2011
quotequote all
Ok. Thanks for the info. Looks like I'll have to manually derotate the images

rxtx

6,050 posts

239 months

Thursday 25th August 2011
quotequote all
Yep. The Orientation tag is st really, its implementation in software either poorly understood or not at all, and the fact photos look fine in your local viewer then aren't correct in a browser is annoying to say the least.

Best option is to remove all Orientation tags from images, or write a small script to actually rotate the image based on the Orientation value, then strip it.

mojitomax

Original Poster:

1,876 posts

221 months

Thursday 25th August 2011
quotequote all
rxtx said:
Best option is to remove all Orientation tags from images, or write a small script to actually rotate the image based on the Orientation value, then strip it.
thanks, although this whole script business sounds a bit technical for me. i'll have to do it the long way with exports from preview

rxtx

6,050 posts

239 months

Thursday 25th August 2011
quotequote all
Be careful, you want a lossless rotate, not a decode-rotate-encode rotate, which will compress it again. Search for "lossless rotate jpeg".

mojitomax

Original Poster:

1,876 posts

221 months

Thursday 25th August 2011
quotequote all
these are just low res pics for forums and the like. I sort all my proper pics from RAW in aperture and photoshop so no worries about multiple lossy jpeg saves.

thanks though