JPEG lossless rotation can only be done if the dimensions (height and width in px) of the image are multiples of MCU (typically 8x8 for 4:4:4 or 16x16 for 4:2:0).
For the uninitiated, MCU is not Marvel Cinematic Universe as the search results might try to confuse you. It's Minimum Coded Units, and a nice explanation is over here:
Edit: the link also closed for me a forgotten open loop about the meaning of an annoying error message Windows XP era. Thanks for making me look it up!
>https://www.impulseadventure.com/photo/rotation-partial-mcu....
Edit: the link also closed for me a forgotten open loop about the meaning of an annoying error message Windows XP era. Thanks for making me look it up!