UIImage always saving in database upside-down in UIInterfaceOrientationLandscapeLeft, regardless of rotating first
===

I have read countless posts about how to rotate an image. My problem is that when my iPad is in `UIInterfaceOrientationLandscapeLeft`, when I take an image with the camera, convert it to `UIImagePNGRepresentation` and save into a blob in my SQLite DB, it always displays upside-down after reading the data. This does not happen when the iPad is orientated with `UIInterfaceOrientationLandscapeRight`.

To clarify: <b>upon taking the image, it always looks right-side-up in the imageView, but once I save it into the DB, it rotates 180o (and subsequently displays as upside-down), but only when the iPad is Landscape Left!!</b>

Here are the two methods I've tried. Neither one has worked.

(1) Rotate the `UIImageView` with the picture, then save as `UIImage`. I can clearly see this one rotating the `imageView`, but it still stores upside-down in the DB.

    if (self.imageView.image!=nil) {
        if ([UIApplication sharedApplication].statusBarOrientation == UIInterfaceOrientationLandscapeLeft) {
            CGAffineTransform rotation = CGAffineTransformMakeRotation((M_PI));
            [imageView setTransform:rotation];
        }
        wineImage = self.imageView.image;
        imgData = UIImagePNGRepresentation(wineImage);
    }

(2) Create a new image and rotate it

    if (self.imageView.image!=nil) {
        if ([UIApplication sharedApplication].statusBarOrientation == UIInterfaceOrientationLandscapeLeft) {
            UIImage * rotatedImage = [[UIImage alloc] initWithCGImage: self.imageView.image.CGImage scale: 1.0 orientation: UIImageOrientationDown];
            //I have also tried UIImageOrientationUp, above, and it makes no difference
            wineImage = rotatedImage;
        }
        else {
            wineImage = self.imageView.image;
        }
        
        imgData = UIImagePNGRepresentation(wineImage);
    }