Just wanted to add this tidbit. Oddly, the front facing camera does not suffer from the same sideways-sent-portrait problem.. that should help muddy the waters a bit, or help clear things up.. idk
To help convolute things, more findings. (Three photo types taken HDR, PORT & AUTO. Each taken "H" horizontally and "P" portriat.)
Phone gallery>details show only HDR_P.jpg(HDR-portriat) as rotation '90', others at '0'. Note: This is the only portriat photo that sends correctly.
Ubuntu image viewer>properties>details>image data>orientation shows all orientations as top-left except the photo PORT_P.jpg(Right-Top).
All photos show correctly in both galleries......!?!?!?
B. Even if the galleries look at both strings of data, the android 'details' and the ubuntu 'properties'.. how are they determining AUTO_P.jpg should be displayed as a portriat?
C. Why then, if there's some secret orient data does android NOT know to simply use that to rewrite the incorrect data.. lol
I give up, hopefully this info will be helpful to someone in the programming dept if not google itself someday. lol