Re: CGImageSourceCreateFromURL failed with error -11
Re: CGImageSourceCreateFromURL failed with error -11
- Subject: Re: CGImageSourceCreateFromURL failed with error -11
- From: "Gary L. Wade" <email@hidden>
- Date: Fri, 08 Aug 2008 17:54:49 -0700
- Organization: DesiSoft Systems
In that case, it sounds like the Image Source code is leaving the file
open, which makes some sense for local files, although it's not
explicitly documented anywhere that I've noticed; if I recall correctly,
this also happens with the similarly-named QuickTime-based APIs.
To continue using CGImageSourceCreateWithURL with a google-plex of image
files, call CGImageSourceCreateImageAtIndex on each of the images in
each of your CGImageSourceRef that you want, save those CGImageRef's off
however you want to, and then CFRelease your CGImageSourceRef.
James Trankelson wrote:
Indeed, for me, this is related to file descriptors. While it's still
unclear to me exactly where the problem lies, some quick fiddling with
opening the files as NSData and creating images from those appears to
be bearing fruit. Thanks!
-j
On Fri, Aug 8, 2008 at 5:51 PM, Jean-Daniel Dupas
<email@hidden> wrote:
Le 8 août 08 à 20:56, Ken Ferry a écrit :
Hi James, Nicholas,
I still bet it's someone holding too many file descriptors open.
Nicholas, when you said this, "but I have forced the thumbnail
creation to have at most 10 files opened at the same time", what did
you mean? You can see what files your process has open using the
lsof command line tool. Use that to check what files you have open.
lsof -p <pid>
If you find that the problem is files staying open longer than you
want, you may be able to work around the issue by bringing the data
into the process with a method like +[NSData dataWithContentsOfURL:]
(I don't see a CF equivalent, but I may be going blind)
It's just hidden in the Core Foundation References:
CFURLCreateDataAndPropertiesFromResource() from Core Foundation URL Access
Utilities Reference
http://developer.apple.com/documentation/CoreFoundation/Reference/CFURLAccessUtils/Reference/reference.html
_______________________________________________
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
_______________________________________________
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
_______________________________________________
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