Ok, more information.
Using
EXIFdata.com to examine the files, my original portrait file on the phone has these properties.
Image Settings
--------------
Orientation: right-top
Image Properties
----------------
Image Width: 4080px
Image Height: 3060pxThe image on tm-img has this:
Image Settings
--------------
Orientation: Undefined
Image Properties
----------------
Image Width: 1600px
Image Height: 1200pxThe image after passing through Windows has this:
Image Settings
--------------
Orientation: N/A
Image Properties
----------------
Image Width: 741px
Image Height: 989pxNote that although portrait, the original file is wider than it is high.
My conclusion is that the phone stores all files as landscape and uses the orientation flag to display them the correct way up.
Windows will recognise the file as being turned to landscape and will save it with the correct height:width ratio.
TM-IMG gets confused!
I can see that a mobile device - phone or tablet - will need to know the orientation so that it can display properly no matter which way up the device is being held. A laptop / desktop machine does not need this.