FlyerTalk Forums - View Single Post - How to add or embed a file, image / photo or video in a post
Old May 25, 2016 | 3:15 pm
  #95  
Zorak
Moderator: Hyatt, American Express; FlyerTalk Evangelist
Community Builder
Active Streak: 30 Days
All eyes on you!
10 Years on Site
 
Join Date: Jun 2015
Location: WAS
Programs: :rolleyes:, DL DM, AA EXP, UA Silver, Hyatt Glob, Mlife Noir (=> Marriott Amb), invol FT beta tester
Posts: 21,669
Apologies if has been covered somewhere already, although I did try to search for likely terms

I think I know what's going on with FT randomly rotating photos -- the EXIF data stored in a photo can specify metadata, including the orientation of the camera when the photo was taken. I have pix taken with my phone held vertically (portrait mode) which are nevertheless reported as 4160x2340 by the "identify" utility in the ImageMagick package. They display correctly oriented on my phone laptop because they know how to interpret the EXIF data.

When you upload a photo to FT, it appears to do some processing on the image (including enforcing max height/width) before storing the image, and I bet whatever software they are using to do this processing, does not know about this EXIF attribute.

Thus in order to upload a photo to FT and preserve the correct orientation, it needs to have this EXIF attribute deleted (and the image rotated locally before it is uploaded, if necessary). ImageMagick's "convert" utility has a "-auto-orient" flag which will do this. Most photo editing software probably lets you edit the EXIF data also?

For further reading:

jpeg exif orientation

jpeg delete exif orientation

ImageMagick docs for convert -auto-orient

Here are 3 different versions of the same source image. On my laptop all three appear correctly oriented.

This is an upload of the original raw image; FT incorrectly displays it in landscape mode:

Name:  20160525_120134.jpg
Views: 553
Size:  355.3 KB

For this upload I resized the image ("convert -resize 25%") but did not change any of its other attributes; FT also shows this in landscape:

Name:  resized.jpg
Views: 566
Size:  238.7 KB

Then I ran "convert -resize 25% -auto-orient" and now the uploaded version displays correctly:

Name:  resized_auto_orient.jpg
Views: 551
Size:  239.5 KB
Zorak is offline