In my finishContentEditingWithCompletionHandler method for my photo editing extension I am able to correctly filter with GPUimage and save images that are NOT taken by the camera. But when I take a picture with the camera and then use my photo editing extension and hit "Done" the extension just sits there on a blank screen with the activity spinner going. Has anyone else encountered this issue? I am using GPUImage to filter my images.
Asked
Active
Viewed 385 times
0
-
We have experienced the same problem. Sometimes it actually will finish, and act as if you never changed the image at all. We have confirmed by saving to a file that we did in fact pass the filtered image back to the OS. It only seems to happen when we are using full resolution photos from the camera. – Xials Sep 18 '14 at 17:45
-
I agree, seems to only be happening on camera photos. If you init with [[GPUImagePicture alloc] initWithImage:image smoothlyScaleOutput:YES]; Then it definitely crashes but sometimes I can get a camera taken photo to finish with [[GPUImagePicture alloc] initWithImage:image]; and then of course adding other effects like sharpen/vignette/etc. But majority of the time it still crashes. Have you had any luck getting it not to since you replied? Would really like to keep using GPUImage but I cannot release this if it keeps crashing like this and will have to find another way to handle filters. – inks2002 Sep 23 '14 at 14:43
-
I experience the same behavior, even though I'm not using GPUImage but my own OpenGL pipeline. It seems that the extension gets killed due to high memory pressure. The limits are much lower for photo extensions—or let's say ridiculously low. In my app I'm able to process 8 MP images without problems; in the extension I need to scale them down to 1/2 MP (depending on the device) in order to get it to work without crashing. – Frank Rupprecht Oct 16 '14 at 08:30
1 Answers
1
I have had similar issues with my custom photo extension. Through some investigation, I found that only images with UIImageOrientation.Up
would be filtered correctly and written back correctly. I ended up removing the orientation information for the UIImage
and it works for me for all image orientations.
// Remove orientation information
UIGraphicsBeginImageContextWithOptions(finalFilteredImage.size, true, finalFilteredImage.scale)
finalFilteredImage.drawInRect(CGRectMake(0, 0, finalFilteredImage.size.width, finalFilteredImage.size.height))
let finalImage = UIGraphicsGetImageFromCurrentImageContext()
UIGraphicsEndImageContext();

Kevin
- 83
- 2
- 8