Hi 

I wrote an image catalog application that scans files on a Windows server, 
extracts certain image file info (like mod date, name, width, height and color 
mode) and writes this info to a database. During testing, in a real 
environment, the app started crashing and I narrowed the problem down to the 
following line of code: 




NSImage  *image  = [[NSImage alloc] initWithContentsOfFile: inPath]; 




If I comment that out, the app never crashes, but I also never get the width, 
height and color info. I used the "instruments" app to watch memory and during 
an initial scan of a directory tree, my app does use a lot of memory (50-60 mb) 
but no where near the Machine's limit of 2 gb. It seems like the OS can't keep 
up with all the image loading and freeing, and just thrashes memory so badly 
that at a certain point, it just refuses to allocate any more.  




I set a breakpoint at " malloc_error_break" as the run log suggested, but it 
always leads back to the method containing the above line. 




Is there some way (other than rolling my own image readers) to just get the 
metadata from a file rather than having to load the entire thing? A third party 
class that would be something like "NSImageInfo" (if Apple had written such a 
class) 




Any help greatly appreciated. 










If I comment that out, the app never crashes, but it also never gets the image 
info I need. 
_______________________________________________

Cocoa-dev mailing list ([email protected])

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to