Quote:
I didn't notice that Photoshop or Paintshop asked me to to decode a pic before rotating it...

No, but if you want to save the rotated version, the image will be encoded again.
This new image format will probably just use a "flag" saved on the file itself to determine the position keeping the image data itself untouched.
To rotate the image only one byte or two would have to be changed and the decoder software would show the image according to the value of that byte.
Something that can be done or added to any image format without much trouble besides compatibility with older software.
:qr