• 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
Re: - [NSBitmapImageRep tiffRepresentation] malloc error
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: - [NSBitmapImageRep tiffRepresentation] malloc error


  • Subject: Re: - [NSBitmapImageRep tiffRepresentation] malloc error
  • From: Thomas Clement <email@hidden>
  • Date: Sat, 13 Dec 2008 15:08:11 +0100

On Dec 12, 2008, at 11:28 PM, David Duncan wrote:

On Dec 12, 2008, at 12:50 PM, Thomas Clement wrote:

The image was 14340 x 14173 (8-bit RGB with no alpha).

Also I got these messages in the console:
kernel[0]: (default pager): [KERNEL]: no space in available paging segments
malloc: *** mmap(size=1073741824) failed (error code=12)
*** error: can't allocate region
*** set a breakpoint in malloc_error_break to debug
Attempt to allocate 1073741824 bytes for NS/CFData failed

Yup, your running into malloc() and VM space issues.

What approach should I take to handle large images?


I don't think there is an equivalent to this in AppKit, but you can do this using Core Graphics & ImageIO. The MassiveImage sample demonstrates how you can stream very large images (up to 32k x 32k iirc) to disk.

<http://developer.apple.com/samplecode/MassiveImage/index.html>

Looks like this is what I need.

Now I also need to read pixel values from images on disk. For the same reason I'd like to avoid loading the entire image into memory.
Is it possible to access pixel values piece by piece? I can't find how to do that using data providers.



Thanks to you and Nick for the help! Thomas

_______________________________________________

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


  • Follow-Ups:
    • Re: - [NSBitmapImageRep tiffRepresentation] malloc error
      • From: David Duncan <email@hidden>
References: 
 >- [NSBitmapImageRep tiffRepresentation] malloc error (From: Thomas Clement <email@hidden>)
 >Re: - [NSBitmapImageRep tiffRepresentation] malloc error (From: David Duncan <email@hidden>)
 >Re: - [NSBitmapImageRep tiffRepresentation] malloc error (From: Thomas Clement <email@hidden>)
 >Re: - [NSBitmapImageRep tiffRepresentation] malloc error (From: David Duncan <email@hidden>)

  • Prev by Date: Re: How to handle document scaling in an NSRulerView Client?
  • Next by Date: Rotating a CALayer more than once is not working
  • Previous by thread: Re: - [NSBitmapImageRep tiffRepresentation] malloc error
  • Next by thread: Re: - [NSBitmapImageRep tiffRepresentation] malloc error
  • Index(es):
    • Date
    • Thread