The orientation info in the EXIF data of the photo is possibly incorrect (either due to some post-processing, or the software used to save it not setting it correctly, or it's not been set correctly in-camera - happened to me before in specific angles). The file says it is landscape although the picture is portrait.
The integrated image viewer does not take it into account (at least on my OS version) so displays it as portrait, but other programs take it into account therefore displaying it (correctly from their point of view) in landscape.
You can simply rotate the image or attempt to fix the EXIF data.