Like so many others have discovered, iPhones shave processing and battery expenditures by writing image orientation data to EXIF data, rather than physically reorienting the image.
I’ve seen cumbersome uses of libraries and such for people seeing a solution with CFIMAGE.
To quote a coworker – quick and dirty – without having to incorporate new classes or jump through tremendous hoops.
First, either by cfimage or imageRead, get the file.
Then, create a structure using ImageGetExifMetaData, so you can get at the Model and possibly Orientation properties.
To correct the rotation, right or right side specifications under Model “iPhone 4″ go clockwise 90 degrees, left or left side seem to work with -90 degrees counterclockwise. ImageRotate will handle this.
Finally, the magic. Manipulating that data either with CFScript or cfimage, and saving down the file WILL preserve the EXIF data. There are a variety of reasons why you might want to strip that out; user privacy, file size, etc.
What WILL get rid of it–again, quick and dirty–is the following:
blankImg = ImageNew("",ImageGetWidth(oldimg),ImageGetHeight(oldimg));
ImagePaste(blankImg,oldimg,0,0);
Then write out that new image. Try ImageGetExifMetaData on the new one, you’ll be pleasantly surprised that with the paste operation, CF does not preserve the EXIF data with the paste operation.
Certainly, this works with CF8. I will test with CF9, and hope that this is not considered a bug. I would hope this absence of functionality, if you will, is a feature, given the absence of an ability to remove or modify the EXIF data by other means.