Hi Igor,
Yes, one can determine vertical/horizontal image by "if width is smaller than height". But, by doing it that way, we can't determine in which direction vertical image must be rotated (left or right).
The problem is, not every photographer hold camera (when taking vertical shots) the same way (and all the time). Me personally, when taking portrait shot, I always hold camera with shutter button being on top (I believe, that's how camera must be held for portrait shot) -but I can't just assume everybody does the same way.
Anyway, I'm working on that right now... have some troubles understanding how exiftool works, though :-)
Greetings,
Bogdan