• 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
Re: saving images on panther
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: saving images on panther


  • Subject: Re: saving images on panther
  • From: "Sean McBride" <email@hidden>
  • Date: Thu, 12 May 2005 10:58:26 -0400
  • Organization: Rogue Research

On 2005-05-12 12:17, Cornelius Jaeger said:

>+ (NSDictionary *) fileRepresentationDictionary
>{
>     return [NSDictionary dictionaryWithObjectsAndKeys:
>         NSTIFFFileType,    @"tif",
>         NSTIFFFileType, @"tiff",
>         NSBMPFileType,    @"bmp",
>         NSJPEGFileType,    @"jpg",
>         NSJPEGFileType,    @"jpeg",
>         NSGIFFileType,    @"gif",
>         NSJPEGFileType,    @"png",
>         nil];

NSTIFFFileType is an enum, not an objective C object, you can't store it
in a dictionary. NSDictionary's can only contain plist types.

>+ (NSBitmapImageFileType)fileTypeForPath:(NSString *)path
>{
>     NSString * ending = [[[path lastPathComponent] pathExtension]
>lowercaseString];
>     return (NSBitmapImageFileType)[[NSImage
>fileRepresentationDictionary] valueForKey:ending];

The need for this cast is a clue of your error.

Also, your fileTypeForPath: method will fail entirely for files without
filename extensions.

Also, don't forget NSPNGFileType and NSJPEG2000FileType.

--
____________________________________________________________
Sean McBride, B. Eng                 email@hidden
Rogue Research                        www.rogue-research.com
Mac Software Developer              Montréal, Québec, Canada


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: saving images on panther
      • From: "Sean McBride" <email@hidden>
References: 
 >saving images on panther (From: Cornelius Jaeger <email@hidden>)

  • Prev by Date: Re: 10.3.9 SDK generates error
  • Next by Date: Re: saving images on panther
  • Previous by thread: saving images on panther
  • Next by thread: Re: saving images on panther
  • Index(es):
    • Date
    • Thread