Open oiledCode opened 11 years ago
I had this same problem also. I tracked it down to GPUImageFilter.m handling of the orientation. Look for the comment "Capture image with current device orientation" line: UIImage *finalImage = [UIImage imageWithCGImage:cgImageFromBytes scale:1.0 orientation:imageOrientation];
I changed this line to and it is fine.
UIImage *finalImage = [UIImage imageWithCGImage:cgImageFromBytes]; // no orientation
If you look at the call stack you notice that the image orientation is determined by [UIDevice currentDevice] orientation]. Which always returns UIDeviceOrientationUnknown unless you call:
[[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications].
I've got the same problem.
I take a photo with the front camera which I then mirror to get an image of what we actually see on the screen : [UIImage imageWithCGImage:newImage.CGImage scale:newImage.scale orientation:UIImageOrientationUpMirrored];
then apply a GPUImageLookupFilter. The resulting processed image has the orientation of the original image ...
Any idea why ?
i use
[GPUImageFilter imageFromCurrentlyProcessedOutputWithOrientation]
to make sure it fetch the right orientation
I had to make a copy of the image first and then use [GPUImageFilter imageFromCurrentlyProcessedOutputWithOrientation].
Tank you for the help.
I'm facing the following problem I'm trying to process a still image grabbed from the photoLibrary . The processed image has a wrong orientation. The image is grabbed using the AssetsLibrary if it can help. Has anyone experienced the same problem?