I used F-Spot on Ubuntu to rotate some photos (JPEG files) before I FTPed them up to my website. This seemed to work just fine. However, if those images are opened in a web browser, they do not show as rotated. Nor do they if I download them to a Windows Vista machine and open them with any standard program there. I suspect that F-Spot rotates images by modifying the exif data or similar, not by actually rotating the images.
So I want a little function which will run on my web server (i.e., PHP or Perl) which will accept an array of file paths, examine the images, and rotate those which need to be rotated, overwriting the original file.
I know some PHP but no Perl.
In the course of searching to see whether this question had already been asked, I came across some ideas. I might be able, after some trial and error, to knock something together using glob(), exif_read_data(), and imagerotate(). I'll try tomorrow. But now I'm going to bed.
In Perl, I think you want "exiftool -Orientation". The PHP equivalent seems to be accessible through "exif_read_data".