Q:

UISlider which blurs image with CiGaussianBlur also rotates image

I have a UISlider which has a range from 0 to 30.
Unfortunately, when I'm using the UISlider, the image starts to blur, BUT it also rotates.
Here's the code:
-(IBAction)slider:(UISlider *)sender
{
    float slideValue = [sender value];

    CIImage *beginImage = [[CIImage alloc] initWithImage:image];
    CIContext *context = [CIContext contextWithOptions:nil];

    CIFilter *filter = [CIFilter filterWithName:@"CIGaussianBlur" keysAndValues:kCIInputImageKey, beginImage, @"inputRadius", [NSNumber numberWithFloat:slideValue], nil];
    CIImage *outputImage = [filter valueForKey:kCIOutputImageKey];

    CGImageRef cgimg = [context createCGImage:outputImage fromRect:[beginImage extent]];
    UIImage *newImg = [UIImage imageWithCGImage:cgimg];

    [imageView setImage:newImg];
    CGImageRelease(cgimg);
}

Where is the problem?
Thanks in advance.

A:

The problem is this line:
UIImage *newImg = [UIImage imageWithCGImage:cgimg];

This is too simple-minded. Call [UIImage imageWithCGImage:cgimg scale:originalScale orientation:originalOrientation]; (you will need to provide correct values for these).

