• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
[SOLVED] Re: NSImage TIFFRepresentation memory leak
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[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


References: 
 >Re: NSImage TIFFRepresentation memory leak (From: Heinrich Giesen <email@hidden>)

  • Prev by Date: Re: Bindings: changing model changes some views but not others (NSTableColumn)
  • Next by Date: Re: Synchronizing Thread Execution
  • Previous by thread: Re: NSImage TIFFRepresentation memory leak
  • Next by thread: Re: Checking if a file is Locked [SOLVED]
  • Index(es):
    • Date
    • Thread