[SOLVED] Re: NSImage TIFFRepresentation memory leak
[SOLVED] Re: NSImage TIFFRepresentation memory leak
- Subject: [SOLVED] Re: NSImage TIFFRepresentation memory leak
- From: Roland Torres <email@hidden>
- Date: Mon, 4 Dec 2006 11:58:27 -0800
On Dec 2, 2006, at 2:23 AM, Heinrich Giesen wrote:
Roland Torres wrote:
Is there an easier way to go from a CIImage to an image file?
Roland wants to writeout a CIImage and to do this he creates an
NSCIImage
and from this he gets data via -TIFFRepresentation.
Troy Stephens gave a code example for a much easier way in:
http://www.cocoabuilder.com/archive/message/cocoa/2005/5/18/136311
Troy Stephens writes:
It's about the same amount of source code as what you had, but avoids
the unnecessary allocation of the intermediate "TIFFRepresentation"
data and NSImage.
Thanks, Heinrich (and Troy Stephens)! The Cocobuilder code segment
works perfectly! It leaks 0 bytes. Plus, I get the option to write
the image out in TIFF, JPG, BMP, PNG, and even GIF89a format.
(FWIW, I can reproduce my original leak in the Cocobuilder code if I
don't free the NSBitmapImageRep. This will cause it to accumulate VM
at the exact same rate as using NSImage -TIFFRepresentation.
Interesting.)
Many thanks to all who have helped, both on-list and off-list!
Roland
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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