Exif Jpeg header parser and thumbnail remover
The only program I've heard of that can attach an EXIF header to an existing JPEG. I wonder if it can fix duplicate rotation tags!?
They reference this article -- one of the very few anywhere on the EXIF file format
I liked the explanation of the EXIF orientation tag from the reference:
The orientation of the camera relative to the scene, when the image was captured. The relation of the '0th row' and '0th column' to visual position is shown as right.
0x0112 unsigned short 1
Value 0th Row 0th Column
1 top left side
2 top right side
3 bottom right side
4 bottom left side
5 left side top
6 right side top
7 right side bottom
8 left side bottom