Re: filling NSImage with binary data from NSData
Re: filling NSImage with binary data from NSData
- Subject: Re: filling NSImage with binary data from NSData
- From: Lester Dowling <email@hidden>
- Date: Mon, 8 May 2006 19:22:21 +1000
On 08/05/2006, at 2:10 PM, John Stiles wrote:
Lester Dowling wrote:
The seg fault happens because the image is not planar. Substitute
"isPlanar:NO" because according to the manual:
I would think that a grayscale image could be considered either planar
or non-planar.
That's what I used to think, too -- it's just what I found to work
reliably in my applications. In this case, you're right though because
I found the seg fault doesn't happen because of the planar setting.
From the OP, the data file is loaded into a global variable, vmrData,
with:
vmrData = [NSData dataWithContentsOfFile:fileName];
These factory methods return an object marked for auto-release. So,
the seg fault happens because the program dereferences this global
object when it has already been auto-released. The problem is fixed by
substituting this line:
vmrData = [[NSData dataWithContentsOfFile:fileName] retain];
Regards,
Lester
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden