Problem to save a CIImage using a CGImageRef
Problem to save a CIImage using a CGImageRef
- Subject: Problem to save a CIImage using a CGImageRef
- From: paul morel <email@hidden>
- Date: Fri, 2 Apr 2010 04:40:38 +0200
- Importance: Normal
Hi ,I'm having some trouble to save an image.
Here is what I do:
NSBitmapImageRep* rep = [[[NSBitmapImageRep alloc] initWithCIImage: myCiImage] autorelease];
CGImageRef image = [rep CGImage];NSURL * url = [NSURL fileURLWithPath: path];
CGImageDestinationRef dest = CGImageDestinationCreateWithURL((CFURLRef)url, (CFStringRef)newUTType, 1, NULL);
if (dest)
{
CGImageDestinationAddImage(dest, image, (CFDictionaryRef)[saveOptions imageProperties]);
if(!CGImageDestinationFinalize(dest))
{NSLog(@"Error writing file");
}
CFRelease(dest);
And I have an error when it is doing CGImageDestinationFinalize(dest)Sometimes it is written : Program received signal: “EXC_BAD_ACCESS”.and sometimes :<Error>: kCGErrorIllegalArgument: CGSReleaseRegion : Invalid region
Does anybody knows where it comes from? Apparently it would come from the conversion from a CIImage to a CGImageRef but I don't undesrtand why.Or is there somebody who would know how to save a CIImage ?
Thanks,
Paul
_________________________________________________________________
Hotmail: Free, trusted and rich email service.
https://signup.live.com/signup.aspx?id=60969_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden