• 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
NSImage buggy when scaling images above real size?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSImage buggy when scaling images above real size?


  • Subject: NSImage buggy when scaling images above real size?
  • From: Wade Tregaskis <email@hidden>
  • Date: Wed, 17 Mar 2004 14:54:04 +1100

I'm working with groups of NSImages in a view similar to iPhoto's (or any such thing), where the images can be viewed at various scales as controlled by a continuous scroller. This works pretty well when the scale is equal to or smaller than the real image sizes - performance isn't quite as good as iPhoto, but it's good enough. Some playing with caching should improve this, I imagine.

The problem occurs when the scale is set larger than the image sizes. For example, in my current test case I have 6 400x400 images. If I set the scale such that they need to be drawn at 401x401 [for example], then somewhere between [and including] setSize: and compositeToPoint: my app locks up completely. It just starts sucking up memory as fast as it physically can, which on my little iBook is as fast as the hard drive can handle (given that OS + XCode in debug mode uses nearly all of the 256 meg physical memory :( ).

I've tried all 4 caching modes (default through never), and while BySize is by far the worst (pretty much requires a hard restart), they all exhibit the problem. No image ever actually makes it to the screen. I have left my app running for up to 10 minutes to see if it's just incredibly slow, but it doesn't seem so - memory usage increases linearly the whole time, to the point where it reaches more than a gigabyte, for images who's on disk size is less than a meg each (as pict's).

Debugging this is compounded by the fact that I can't - this thrashing locks up my iBook almost completely. The best I can manage is to throw a few mouse clicks at XCode's Terminate button and go for coffee, so to speak. It takes about 3 minutes on average just to change to XCode and trigger that kill. It would be nice if XCode had an option to manipulate the environment limits of the apps it launches.

Is there any reason scaling an image above it's real size would exhibit this behaviour, and more importantly how can I make it not? I'll probably alter my code in the meantime to avoid scaling above real size, but sooner or later I'm going to have to be able to zoom in on an image... :/

Wade Tregaskis
-- Sed quis custodiet ipsos custodes?
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.


  • Prev by Date: [Q] mapping graphical items to NSViews
  • Next by Date: Re: "Designated Initializer" pattern
  • Previous by thread: Re: [Q] mapping graphical items to NSViews
  • Next by thread: Re: NSImage buggy when scaling images above real size?
  • Index(es):
    • Date
    • Thread