OK, here's a first version, attached, if anyone wants to test it out. Might be a good idea to limit testing to one image or a test thread at least until you make sure it works.
To use this, install the product then edit a post with an attachment and double click the attachment. You should get the existing "attachment config" editor popup (Edit: actually it's called "Image Settings"), and it should have an added row of radio buttons for "Rotation". Select a rotation angle, press "Save" in the popup, press "Save" to save the edit, then refresh the browser (Ctrl-F5 in FF).
There are a couple of issues: because of the way attachments are inserted in posts, you won't see the rotated image until you force a reload of the page and bypass the browser cache. You can fix that issue by editing the file includes/class_bbcode_alt.php and making these changes (sorry, couldn't do it with a plugin):
Around line 245, find this code and add the part in red (including the comma):
Code:
$attachments = $vbulletin->db->query_read_slave("
SELECT a.settings, a.attachmentid, a.filename, a.dateline
FROM " . TABLE_PREFIX . "attachment AS a
WHERE
a.attachmentid IN (" . implode(',', $matches[1]) . ")
LIMIT 50
");
Then around line 260 find this code and change part in red:
Code:
$attribs = array(
'src' => $vbulletin->options['bburl'] . '/attachment.php?attachmentid=' . $attachmentid . '&stc=1&d='.$ids[$attachmentid]['dateline'],
'attachmentid' => $attachmentid,
'alt' => '',
'id' => 'vbattach_' . $attachmentid,
);
(note that the above change is really two additions, &d= before the existing single quote, and the rest after the quote and before the existing comma).
You don't have to make those changes, but again if you don't you won't see the rotated image until you force a refresh (Ctrl-F5).
Also, when you're in the editor you won't see the image rotated in the editor until you hit save (I'm still working on that one).
One other thing: this only works if you have the GD library configured in your php. If someone's using Imagmagick instead I might be persuaded to add support for that.
I'll be releasing this as a mod soon, but was hoping to get at least one person to test it first.
[Edit: removed attachment, not working]