• 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
loading images from external disk
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

loading images from external disk


  • Subject: loading images from external disk
  • From: Gabriel Zachmann <email@hidden>
  • Date: Fri, 30 Oct 2009 19:38:34 +0100

I am loading images from an external disk, about one image per second.

My code looks like this:

filename_ = [list_ objectAtIndex: index_];
NSLog( @"orig filename = %@", filename_ );
NSURL * url = [NSURL fileURLWithPath: filename_ isDirectory: NO]; // this escapes any characters that are not allowed in URLs, I think
if ( url == NULL )
...
NSLog( @"url = '%@'", url );
CGImageSourceRef sourceRef = CGImageSourceCreateWithURL ( (CFURLRef) url, NULL );
if ( sourceRef == NULL )
output error message to the log


Now, one user has reported that, occasionally, CGImageSourceCreateWithURL() fails -- I can tell from the log I received.

I have never seen a case where -fileURLWithPath has failed.

The paths of the images look like "/Volumes/MaxtorMac1/Verses/ image.jpg".
I haven't seen any weird characters, except an occasional space.
But CGImageSourceCreateWithURL() failed even with paths that contained no space at all.


I have no idea, in which direction to look for the bug.

Could some kind soul suggest which direction to explore?
Should I further massage the filename or URL somehow, in order to avoid the failures?
Could it have anything to do with the images being on an external disk?


(Since I'm loading one image per second, the bug could not be caused by the external disk going to sleep, could it?)

Thanks a lot in advance.

Best regards,
Gabriel.


____________________________________________________________ Eigentlich bin ich ganz anders, nur komme ich so selten dazu. ( Ödön von Horváth ) ____________________________________________________________ http://zach.in.tu-clausthal.de ____________________________________________________________









Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

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: loading images from external disk
      • From: Jens Alfke <email@hidden>
  • Prev by Date: Re: Creating a tiled image from resource images
  • Next by Date: Re: EndianU32_NtoB
  • Previous by thread: Re: Creating a tiled image from resource images
  • Next by thread: Re: loading images from external disk
  • Index(es):
    • Date
    • Thread