Re: Managing image loading

2014-02-11 Thread Leonardo
that NSData and create the image. It sounds linear and clean. Good luck to myself. I'll let you know. Regards -- Leonardo > Da: Jens Alfke > Data: Sat, 8 Feb 2014 16:37:01 -0800 > A: Leonardo > Cc: > Oggetto: Re: Managing image loading > > > On Feb 8, 2014,

Re: Managing image loading

2014-02-08 Thread Jens Alfke
On Feb 8, 2014, at 3:58 AM, Leonardo wrote: > When the user imports a new image, I quickly copy the image to a temporary > folder, then I add this latest file reference to the document’s NSFileWrapper. > I just create the file’s fileWrapper using its URL, so I do not read its > content and cre

Re: Managing image loading

2014-02-08 Thread Kyle Sluder
On Feb 8, 2014, at 3:58 AM, Leonardo wrote: > > I had to scratch my head at managing the undo, but I found a solution here > too. > When the user undo the import of an image, if the images has been never > saved, so it is still within the temporary folder, I just remove the image > file reference

Re: Managing image loading

2014-02-08 Thread Leonardo
the fileWrapper uses the disk or keeps the NSData in memory. So in case of a 1GB file I do not engulf the app. I hope I have designed a good architecture. Regards -- Leonardo Da: Jens Alfke Data: Tue, 4 Feb 2014 11:47:35 -0800 A: Leonardo Cc: Oggetto: Re: Managing image loading On Feb 4

Re: Managing image loading

2014-02-04 Thread Jens Alfke
On Feb 4, 2014, at 9:03 AM, Leonardo wrote: > - When the user imports a new image, I add its NSData to the NSFileWrapper >[docFileWrapper addRegularFileWithContents:imgData >preferredFilename:@"image.png"]; > and retain the NSImage. So I can draw the NSImage at any time. You don't n

Re: Managing image loading

2014-02-04 Thread Leonardo
arge GBs. Does all of that sound good? Regards -- Leonardo Da: Jens Alfke Data: Tue, 4 Feb 2014 07:41:41 -0800 A: Leonardo Cc: Oggetto: Re: Managing image loading On Feb 4, 2014, at 3:05 AM, Leonardo wrote: > My app displays several images on several pages. > Since the app displays

Re: Managing image loading

2014-02-04 Thread Jens Alfke
On Feb 4, 2014, at 3:05 AM, Leonardo wrote: > My app displays several images on several pages. > Since the app displays one page per time, I would like to optimize the > memory management at loading and displaying the images. It'd be best to explicitly release/free the images for a page when th